Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET jQuery script
I think this is interesting...
 
As far as I can remember we used to put our script references in the
 <head> 
tags. But a ScriptManager has to be placed inside the
<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 26-Jan-12 3:17am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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?
  Permalink  
Comments
newkie at 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 at 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)



Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 26 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100