This is probably to do with how the javascript is rendered (somewhere in the middle) in the completed page that goes to the browser.
I would put the javascript in a .js file. Then in the page_load event of the content page you can get a reference to the master (can't recall syntax off the top of my head but it's something like: Page.Master) then attach a script block using Master.ClientRegisterScriptBlock where the Src property is the relative path to the .js file.
Sorry I can't give exact code this very moment, If I get a chance I will post it.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
Offline 1,181 posts
since Feb 2005