I have a user control with a RadListBox in it. The Page_Load event of the user control calls ScriptManager.RegisterClientScript to register a js file. The RadListBox has an OnClientLoad property referencing a function in the js file.
When I load the page with the user control I get a script error because the js file isn't loaded yet. But how can that be? RegisterClientScript puts a script tag in the head tag and OnClientLoad should only fire once the page is loaded. And when the page is loaded shouldn't the script tag already have been processed?
After that initial error everything seems to work ok because by then the script is finally loaded.
I tried putting the reference to the file directly into page that hosts the control but I still get the same error.
When I load the page with the user control I get a script error because the js file isn't loaded yet. But how can that be? RegisterClientScript puts a script tag in the head tag and OnClientLoad should only fire once the page is loaded. And when the page is loaded shouldn't the script tag already have been processed?
After that initial error everything seems to work ok because by then the script is finally loaded.
I tried putting the reference to the file directly into page that hosts the control but I still get the same error.