I’m looking to somehow get jQuery inserted into every page with the MINIMUM of code written… in other words I don’t want to write <script language='javascript' src='PATH TO JQUERY'></script> on every single aspx page.
So far I’ve thought of using a Base class and inserting a ‘Response.Write’ into the ‘page load’ event. Besides that, what are my other options… web.config? something else?
Bonus points for a Webforms/MVC solution. Thanks for any suggestions.
EDIT: Found an answer that I like at http://www.codeproject.com/KB/aspnet/scriptregister.aspx The author, like myself, disliked the standard implementation of ClientScript.RegisterClientScriptBlock because of various reasons (like MSFT insistance of having a FORM runat=server tag) and built a better mousetrap.
Use MasterPages and put it at the top. Some people say put it at the bottom but after the first time it’s loaded it cached anyways and if you are going to manipulate the DOM I personally would rather do it before my user really starts to see the page being rendered. Having it at the bottom could definitely cause this to happen and could be confusing to the user and result in a bad user experience.