JQuery Integration in ASP.NET Web Forms 4.5

I used Visual Studio 2012 and the built-in template (under Add → New Project) to create a new ASP.NET Web Forms web application project. Inside the Site.Master page provided by default, I see some jQuery markup targeting, which is included below.

How does ASP.NET determine the paths required to enable jQuery, given the following labeling?

<asp:ScriptManager runat="server">
    <Scripts>
        <%--Framework Scripts--%>
        <asp:ScriptReference Name="MsAjaxBundle" />
        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="jquery.ui.combined" />
        <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />
        <%--Site Scripts--%>
    </Scripts>
</asp:ScriptManager>

I do not see a configuration file or code anywhere that would allow jquery to "~ / Scripts / jquery-1.7.1.js". I see the package.config file, but it does not explicitly describe the path that should be somehow calculated.

Does anyone know how the path to javascript jquery file is allowed at runtime?

+5
1

Microsoft.ScriptManager.WebForms PreAppStartCode :

        System.Web.UI.ScriptManager.ScriptResourceMapping.AddDefinition("WebFormsBundle", new ScriptResourceDefinition
        {
            Path = "~/bundles/WebFormsJs",
            CdnPath = "http://ajax.aspnetcdn.com/ajax/4.5/6/WebFormsBundle.js",
            LoadSuccessExpression="window.WebForm_PostBackOptions",
            CdnSupportsSecureConnection = true
        });

, script:

<asp:ScriptReference Name="WebFormsBundle" />

, ScriptReference , BundleConfig.cs

+2

All Articles