Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From .Net framework 4.0 ScriptManager support script mapping feature. So, you can register (associate) any name (even for your own scripts) with scripts paths. The main benefits is that you can specify scripts to be used for debug, release configuration. You also have ability to specify CDN location of scripts. ScriptManager will choose correct one for current configuration during runtime. </p> <p>Basically script mapping is registered in application start as in the following example:</p> <pre><code>void Application_Start(object sender, EventArgs e) { // map a simple name to a path ScriptManager.ScriptResourceMapping.AddDefinition("jQuery", new ScriptResourceDefinition { Path = "~/scripts/jquery-1.7.1.min.js", DebugPath = "~/scripts/jquery-1.7.1.js", CdnPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.7.1.min.js", CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.7.1.js" }); } </code></pre> <p><strong>Edit:</strong> In ASP.NET 4, were added the concept of a PreApplicationStart method that an assembly can use to execute code early on in the appdomain without any configuration. So, registration mapping is added by AspNet.ScriptManager.jQuery and AspNet.ScriptManager.jQueryUI libraries which is added by default in template via nuget.</p> <p>Basically this library consist from one class as in the following example:</p> <pre><code>[EditorBrowsable(EditorBrowsableState.Never)] public static class PreApplicationStartCode { public static void Start() { string str = "2.0.3"; ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition() { Path = "~/Scripts/jquery-" + str + ".min.js", DebugPath = "~/Scripts/jquery-" + str + ".js", CdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-" + str + ".min.js", CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-" + str + ".js", CdnSupportsSecureConnection = true, LoadSuccessExpression = "window.jQuery" }); } } </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. 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