Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I think this is interesting...

As far as I can remember we used to put our script references in the
HTML
<head>
tags. But a ScriptManager has to be placed inside the
HTML
<form>
tags.

This means if you are including a library like jQuery via your ScriptManager on your masterpage that any script using jQuery in ContentPlaceHolders above the ScriptManager placement will fail.

Odd, isn't it? You'd think that ScriptManager would be the one control that Microsoft would allow to be placed outside the form or simply render it's contents in head tags.

Meanwhile, I'm going to take my jQuery references out of the ScriptManager and stick them in the head. We have a ContentPlaceHolder in the head and a number of pages are using that for their script.
Posted

1 solution

Free points! Is there a question you want us to answer or would you be better posting this as an observation in the lounge or a personal blog post?
 
Share this answer
 
Comments
Chris_Green 26-Jan-12 11:25am    
I was hoping for validation that there isn't a way to do this. Sorry the question wasn't clear. I might be clever enough to sound like I know what I'm talking about, but not clever enough to know there isn't a better way.
Wonde Tadesse 26-Jan-12 21:12pm    
Value point. 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900