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

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

4 Answers 358 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
David Nelson
Top achievements
Rank 1
David Nelson asked on 27 Apr 2011, 10:03 PM
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?

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 28 Apr 2011, 09:47 AM
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.

0
David Nelson
Top achievements
Rank 1
answered on 28 Apr 2011, 05:16 PM
I added the Telerik.Web.UI.StyleSheetFolders setting to the web.config like you suggested but the error message didnt change at all. Ideas?
0
Simon
Telerik team
answered on 29 Apr 2011, 09:03 AM
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.

0
Ashok
Top achievements
Rank 1
answered on 09 Dec 2011, 04:23 PM
I have same issue
Tags
ScriptManager and StyleSheetManager
Asked by
David Nelson
Top achievements
Rank 1
Answers by
Simon
Telerik team
David Nelson
Top achievements
Rank 1
Ashok
Top achievements
Rank 1
Share this question
or