Reputation: 1002
I am using the Jquery library, and I understand the suggested approach is to reference it at the bottom of web page, within the <body>
tag & not withing the <head>
tag. But when using MasterPages with ASP.net, if I include the Jquery library at the bottom of the MasterPage, then my individual script files included in .aspx files won't work because, Jquery library will not be loaded by then.
What is the best approach to include Jquery library while using MasterPages in ASP.net and at the same time not call in the <head>
tag?
Upvotes: 1
Views: 659
Reputation: 20617
ASP.NET with masterpages, script reference best approach is in the <head id="head1" runat="server">
tag. If you need inline script, just inject them via RegisterStartupScript
with .ready()
and let ASP.NET and jQuery do the work for you.
Upvotes: 0
Reputation: 887395
You can make a separate ContentPlaceholder after the jQuery <script>
tag in the master, and include your other scripts in it in the content pages.
Upvotes: 3