I have a control that on 1 page is initially shown, but on another page is initially hidden.
For the page that initially shows the control, the javascript in the control works fine, but for the page that initially hides the control, the javascript doesn't work.
I've ended up registering the javascript in the code behind using:
this.Page.ClientScript.RegisterClientScriptBlock(...);
It works fine, but it gets ugly with large javascript blocks. Plus it I want to change it, I have to rebuild the solution, which I'd rather not have to do.
Is there another way to register javascript using markup if it isn't sent to the browser when the page is loaded? I'm trying to keep network traffic slim by only sending what I need to the browser when the page loads.
thanks,
Mark