you can use
Sys.Application.add_load (WireEvents); // fix wiring for .NET ajax updatepanel
as
<script language="javascript" type="text/javascript"> // <![CDATA[ Sys.Application.add_load(WireEvents); // fix wiring for .NET ajax updatepanel $(WireEvents); // handle page load wiring using jquery. This will fire on page load function WireEvents() { //do stuff here }; // ]]> </script>
oh and one more thing. be careful with funciton names. otherwise it will be a mess. try something like this
<script language="javascript" type="text/javascript"> // <![CDATA[ Sys.Application.add_load(WireEvents_<%=this.ID%>); // fix wiring for .NET ajax updatepanel $(WireEvents_<%=this.ID%>); // handle page load wiring function WireEvents_<%=this.ID%>() { };// end WireEvents_ // ]]> </script>
so basically adding _<%=this.ID%> to the funciton name ensures that each instance of the control calls its own function. assuming you can have multiple instances of the control. If not at least it prevents confusion when calling wireevents for different controls
robert
source share