Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How to bundle MSAjax and WebForm To my Custom Path?

$
0
0

Hi,

I used Updatepanel in my project and Now I want to remove all webresource.axd and scriptresource.axd from my projects, the Microsoft use this code to bundle all scripts

            bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include("~/Scripts/WebForms/WebForms.js","~/Scripts/WebForms/WebUIValidation.js","~/Scripts/WebForms/MenuStandards.js","~/Scripts/WebForms/Focus.js","~/Scripts/WebForms/GridView.js","~/Scripts/WebForms/DetailsView.js","~/Scripts/WebForms/TreeView.js","~/Scripts/WebForms/WebParts.js"));

            // Order is very important for these files to work, they have explicit dependencies
            bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include("~/Scripts/WebForms/MsAjax/MicrosoftAjax.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));

// WebPage
        <asp:ScriptManager runat="server">
            <Scripts>
                <asp:ScriptReference Name="MsAjaxBundle" />
                <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" />
            </Scripts>
        </asp:ScriptManager>

and this code generate to these two links and add to my page and works well.

<scriptsrc="/bundles/MsAjaxJs?v=c42ygB2U07n37m_Sfa8ZbLGVu4Rr2gsBo7MvUEnJeZ81" type="text/javascript"></script><scriptsrc="/bundles/WebFormsJs?v=IhyKgYYyZAO7M3834lAVvb0-9FJ5c1SClW2TZ_0u-eI1" type="text/javascript"></script>

now

I want bundle all js files to a single file, I want to bundle all MSAjax  and Webform to this path"~/MyCustom/SingleFile" but  When I bundle all js files in to this path, scriptmanager register again all MSAjax and webform webresource.axd and scriptresource.axd  to my page.

            // this is my code bundle all js files to single and works correctly
value.Add(new ScriptBundle("~/MyCustom/SingleFile").IncludeDirectory("~/Scripts", "*.js", true));

how to add this custom path to my scriptmanager for MSAjax and WebForm??????????


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>