In my Page_Load I identify the page header block from my master page and add javascript from an XML file to that part of the page.
It doesn’t seem to be loading in time. If I explicitly put the script reference on the page, it works. But not when I load through the page_load event.
Should it be loaded sooner?
You’re not adding any code so I’m not able to tell you what you’re doing wrong. Instead, I’ll tell you a valid way to add script references from code behind.
Something like this on
Page_Loadshould do the trick