RadStyleSheetManager Error when AjaxFrameworkMode="Disabled"

2 posts, 0 answers
  1. Farid Hayati
    Farid Hayati avatar
    17 posts
    Member since:
    Mar 2011

    Posted 10 Feb 2012 Link to this post


    We are trying to create lightweight page and we want combine css and javascript to reduce requests.

    But we are not using any Ajax on the page. 

    Aspx page mark-up: 
      <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager
          id="StyleSheetManager" 
          runat="server" >   
          <StyleSheets >
            <telerik:StyleSheetReference Path="~/Webforms/UI/Mobile/as.mobile.default.theme.min.css" />
            <telerik:StyleSheetReference Path="~/Webforms/UI/Mobile/jquery.mobile.structure-1.0.1.min.css" />
          </StyleSheets>
        </telerik:RadStyleSheetManager>
      </head>
      <body>
        <form id="form1" runat="server">
          <telerik:RadScriptManager       
            ID="ScriptManager"
            Runat="Server" 
            ClientIDMode="Static"
            EnableScriptCombine="true" 
            OutputCompression="AutoDetect" 
            ScriptMode="Release"
            AjaxFrameworkMode="Disabled"
            EnablePartialRendering="false" 
            CompositeScript-ScriptMode="Release"
            LoadScriptsBeforeUI="false" >
            <CompositeScript>       
              <Scripts>
                <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" />
                <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" />
                <asp:ScriptReference Name="jQuery" />
              </Scripts>
            </CompositeScript>
          </telerik:RadScriptManager>
        </form>
      </body>
    </html>


    So we set AjaxFrameworkMode="Disabled" and added the additional scripts.  On load the page give the following error on "Sys.Application.add_load(loadHandler); line":  

    Uncaught ReferenceError: Sys is not defined 
    <script type="text/javascript">
    //<![CDATA[
    ;(function() {
                            function loadHandler() {
                                var hf = $get('StyleSheetManager_TSSM');
                                if (!hf._RSSM_init) { hf._RSSM_init = true; hf.value = ''; }
                                hf.value += ';|634643790138684980:20a54711:5489a487';
                                Sys.Application.remove_load(loadHandler);
                            };
                            Sys.Application.add_load(loadHandler);
                        })();//]]>
    </script>


    how can we achieve this. 


    Thank you

    Farid
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 14 Feb 2012 Link to this post

    Hello Farid,

    When you set AjaxFrameworkMode to Disabled you are stopping *all* ASP.NET AJAX framework scripts, which includes the base ones, defining Sys. So you need to include them as well manually. The scripts are MicrosoftAjax.js and MicrosoftAjaxWebForms.js. Please read more on the topic here.

    All the best,
    Simon
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top