What is the difference between those three code samples here below? Is one better than the others and why?
1.Page.ClientScript.RegisterClientScriptInclude(typeof(demo), 'jQuery', ResolveUrl('~/js/jquery.js')); 2. <asp:ScriptManager runat='server'> <Scripts> <asp:ScriptReference Path='~/jquery-1.2.6.min.js' /> <asp:ScriptReference Path='~/jquery.blockUI.js' /> </Scripts> </asp:ScriptManager> 3. <script type='text/javascript' src='/js/jquery.latest.js'></script>
I’ve seen people using jQuery in their examples, and each one of them brings jQuery into ASP.NET in a different way. What is the best way?
The first one is
The second one is
The third one is
I typically prefer the last one over the second one, but I never use Ajax anyway, and the first it only needed when you want to add in script after a postback to the server is done