Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately the ScriptResourceMapping is required. However, with a bit of work you can remove the reference from the ScriptManager so it won't render jQuery again.</p> <p>Create your own class that derives from ScriptManager in your web project:</p> <pre><code>using System; using System.Linq; using System.Web.UI; namespace WebApplication46 { public class CustomScriptManager : ScriptManager { protected override void OnInit(EventArgs e) { Page.PreRenderComplete += Page_PreRenderComplete; base.OnInit(e); } private void Page_PreRenderComplete(object sender, EventArgs e) { var jqueryReferences = Scripts.Where(s =&gt; s.Name.Equals("jquery", StringComparison.OrdinalIgnoreCase)).ToList(); if (jqueryReferences.Count &gt; 0) { // Remove the jquery references as we're rendering it manually in the master page &lt;head&gt; foreach (var reference in jqueryReferences) { Scripts.Remove(reference); } } } } } </code></pre> <p>Next, configure a tagMapping entry in your web.config so that ASP.NET will use your custom ScriptManager instead of the one in the box:</p> <pre><code>&lt;system.web&gt; &lt;pages&gt; &lt;tagMapping&gt; &lt;add tagType="System.Web.UI.ScriptManager" mappedTagType="WebApplication46.CustomScriptManager" /&gt; &lt;/tagMapping&gt; &lt;/pages&gt; &lt;/system.web&gt; </code></pre> <p>That's it. Now your CustomScriptManager will ensure all jQuery references are removed from itself before the ScriptManager has a chance to start its rendering logic and you'll still satisfy all the requirements for UnobtrusiveValidation to work (assuming you have a reference to jQuery in your page's tag).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload