Last post Feb 16, 2009 02:39 PM by schadha
Feb 16, 2009 08:34 AM|schadha|LINK
I am creating a new control where I need to include an external .js file in the control. Another js part is, that I have some code that needs to be called like bkLib.onDomLoaded where bkLib is the object from the external js file.
Now everything works ok, but as soon as I create multiple instances of the control on the page, I see 2 issues:
1- I see that the external .js file is being retrieved twice, which is not good and unneccessary, as the first .js file can support n number of instances.
2- The onLoad event of only the last control is fired.
Can someone please help me with the above 2 issues.
Feb 16, 2009 08:56 AM|MetalAsp.Net|LINK
1. I think you can use the RegisterClientScriptInclude method, having checked using IsClientScriptIncludeRegistered first.
2. That's suprising. How did you determine that?
Feb 16, 2009 02:39 PM|schadha|LINK
The problem is solved from
point 2: I think I was incorrect in determining this, as I see now all usercontrols seem to be executing the onload event. So this must be a problem earlier due to multiple include.