RadStyleSheetManager Error: Object reference not set to an instance of an object.

5 posts, 0 answers
  1. David Nelson
    David Nelson avatar
    4 posts
    Member since:
    Oct 2006

    Posted 27 Apr 2011 Link to this post

    I am using RadControls for ASP.NET AJAX Q1 2010 SP1 for the project I am working on.

    I am trying to use the RadStyleSheetManager to consolodate and compress my external css files. In my master page, inside the <form> tag I am trying to add the following:
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" OutputCompression="AutoDetect">
        <StyleSheets>
            <telerik:StyleSheetReference IsCommonCss="False" Path="/style/styles.css" />
            <telerik:StyleSheetReference IsCommonCss="False" Path="/RadControls/Menu/Skins/Default/Menu.Default.css" />
            <telerik:StyleSheetReference IsCommonCss="False" Path="/RadControls/Grid/Skins/ShopIngenix/Grid.ShopIngenix.css" />
            <telerik:StyleSheetReference IsCommonCss="False" Path="/RadControls/Grid/Skins/PriceList/Grid.PriceList.css" />
        </StyleSheets>
    </telerik:RadStyleSheetManager>


    When I run the project I get the following error:
    Server Error in '/' Application.
    --------------------------------------------------------------------------------
     
    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
     
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
     
    Source Error:
     
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
     
    Stack Trace:
     
     
    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Web.UI.ScriptEntrySlot.GetSerializedAssemblyInfo(ScriptEntry scriptEntry) +208
       Telerik.Web.UI.ScriptEntrySlot.SerializeScriptEntry(ScriptEntry scriptEntry) +71
       Telerik.Web.UI.ScriptEntryUrlBuilder.TryAddScriptEntry(ScriptEntry scriptEntry) +56
       Telerik.Web.UI.ScriptEntryUrlBuilder.RegisterScriptEntry(ScriptEntry scriptEntry) +237
       Telerik.Web.UI.RadStyleSheetManager.Page_PreRenderComplete(Object sender, EventArgs e) +258
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8701886
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1029


    All the css files exist, and are valid. I am not sure where to even begin. I checked my web.config and I have the httpHandlers:
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" verb="*" validate="false" />
    </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="URLRewriter" type="URLRewriter.ModuleRewriter, URLRewriter"/>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
        </httpModules>
    </system.web>


    Ideas?
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 28 Apr 2011 Link to this post

    Hi David Nelson,

    What you are trying to use is a new feature of RadStyleSheetManager, which we added for Q1 2010 SP1. In order to combine external style sheet files you need to target a specific folder or folders that store the files.

    Please see this forum thread for more information about the usage of the feature. In your case you will need multiple style sheet folders so you can use this setting:
    <appSettings>
        <add key="Telerik.Web.UI.StyleSheetFolders" value="/style/,/RadControls/" />
    </appSettings>

    I hope this helps.

    Best wishes,
    Simon
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Nelson
    David Nelson avatar
    4 posts
    Member since:
    Oct 2006

    Posted 28 Apr 2011 Link to this post

    I added the Telerik.Web.UI.StyleSheetFolders setting to the web.config like you suggested but the error message didnt change at all. Ideas?
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 29 Apr 2011 Link to this post

    Hi David Nelson,

    It seems I have given you wrong information in my previous post, so please excuse me for my mistake.

    External style sheet support has been added to RadStyleSheetManager in Q3 2010 SP1, so any previous version will throw the exception you are observing when non-embedded style sheets are registered in RSSM.

    If you cannot upgrade I suggest you embed the css files you need into an additional assembly and include it in your application.

    I hope this helps.

    Best wishes,
    Simon
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Ashok
    Ashok avatar
    3 posts
    Member since:
    Nov 2011

    Posted 09 Dec 2011 Link to this post

    I have same issue
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017