This is a migrated thread and some comments may be shown as answers.

RadStyleSheetManager Error when AjaxFrameworkMode="Disabled"

1 Answer 92 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Farid Hayati
Top achievements
Rank 1
Farid Hayati asked on 10 Feb 2012, 01:48 PM

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

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 14 Feb 2012, 02:48 PM
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 >>
Tags
ScriptManager and StyleSheetManager
Asked by
Farid Hayati
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or