locked
How to set the properties for the control toolkit extenders when using the CDN? RRS feed

  • Question

  • User-1833980242 posted

    I'm not sure how to set the properties on the Ajax Control Toolkit controls using the CDN (not including the library in the project).  I'm using the modal popup extender and I'm not sure how to set the properties like the TargetCotrolID since I don't have the Modal Popup Expender on the page.  Do I have to set a reference or something to pull it in to the page or is are there additional things I need to do like register the assembly at the top of the page?

    This is how I did it before I used the CDN:

    <ajax:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="btnHidden" 
                BehaviorID="MPBehavior1" PopupControlID="pnlModalPopUp" >
        </ajax:ModalPopupExtender>
        
        <asp:Button ID="btnHidden" runat="server" Text="Button" style="display: none;" />

    Tuesday, April 8, 2014 1:38 PM

Answers

  • User-417640953 posted

    Hi newbie2C#,

    Thanks for your post.

    As for Ajax control toolkit wiht the CDN, when using ASP.NET 4, you can redirect all requests for ASP.NET framework scripts to the CDN.

    Retrieving scripts from the CDN instead of your local web server can substantially improve the performance of public ASP.NET websites.

    Use the ScriptManager EnableCDN property to redirect all ASP.NET framework script requests to the Microsoft Ajax CDN:

    <asp:ScriptManager  ID="ScriptManager1"  EnableCdn="true"  Runat="Server" />  
    

    There is a new documnet for Microsoft Ajax Content Delivery Network, please follow it.

    http://www.asp.net/ajaxlibrary/cdn.ashx

    Hope that helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 10, 2014 2:03 AM

All replies

  • User1208776063 posted

     Do I have to set a reference or something to pull it in to the page or is are there additional things I need to do like register the assembly at the top of the page?

    AFAIK, I do not think you can use AjaxControls without referencing the library from your local project. You need to add a project reference to AjaxControlToolKit and register ajax tag in order to use the controls.  You can set EnableCdn="true" for ScriptManager or ToolkitScriptManager to get ASP.NET framework scripts from Microsoft Ajax CDN.

    Tuesday, April 8, 2014 1:56 PM
  • User-1833980242 posted

    Thanks for the reply! I've added references to dlls included in my project in the past, but not for a file hosted on the CDN.  How do I add a reference to the Modal Popup Extender hosted on the CDN? 

    Tuesday, April 8, 2014 2:13 PM
  • User-417640953 posted

    Hi newbie2C#,

    Thanks for your post.

    As for Ajax control toolkit wiht the CDN, when using ASP.NET 4, you can redirect all requests for ASP.NET framework scripts to the CDN.

    Retrieving scripts from the CDN instead of your local web server can substantially improve the performance of public ASP.NET websites.

    Use the ScriptManager EnableCDN property to redirect all ASP.NET framework script requests to the Microsoft Ajax CDN:

    <asp:ScriptManager  ID="ScriptManager1"  EnableCdn="true"  Runat="Server" />  
    

    There is a new documnet for Microsoft Ajax Content Delivery Network, please follow it.

    http://www.asp.net/ajaxlibrary/cdn.ashx

    Hope that helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 10, 2014 2:03 AM