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

StyleSheeetRegistrar generating duplicate output in nested layout scenario

0 Answers 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sydney
Top achievements
Rank 1
Sydney asked on 24 Mar 2011, 08:33 PM
What is the proper way to use the StyleSheetRegistrar in an MVC3 Razor nested layout scenario?  I have the following code, but it is outputting the css block twice:

Main Layout

@(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group
                   .DefaultPath("~/Style/")
                       .Add("messages.css")
   //.Combined(true)
   .Compress(true)))
 
   @RenderSection("StyleSheets", false)


Child Layout

@section StyleSheets {
    @(Html.Telerik().StyleSheetRegistrar().StyleSheets(group => group
                        .Add("~/Style/2010.3.1318/telerik.common.css")
                        .Add("~/Style/2010.3.1318/telerik.webblue.css")
                              .Add("~/Style/Base.css")
                              .Add("~/Style/Site.css")
                              .Add("~/Style/Tables.css")
                              .Add("~/Style/BreadCrumb.css")
                              .Add("~/Style/Forms.css")))
    @RenderSection("StyleSheets", false)
}

Thanks
Tags
General Discussions
Asked by
Sydney
Top achievements
Rank 1
Share this question
or