This question is locked. New answers and comments are not allowed.
Hello,
We are already using the Telerik ScriptRegistrar in our MVC website, and now wish to use the StyleSheetRegistrar
The ScriptRegistrar allows to to add scripts to the bottom of the HTML from any page/usercontrol. Can we use StyleSheetRegistrar to add css files to the Head from any page/usercontrol? We can't get it to work this way. For example:
1) Add site wide stylesheet to Default.Master
We are already using the Telerik ScriptRegistrar in our MVC website, and now wish to use the StyleSheetRegistrar
The ScriptRegistrar allows to to add scripts to the bottom of the HTML from any page/usercontrol. Can we use StyleSheetRegistrar to add css files to the Head from any page/usercontrol? We can't get it to work this way. For example:
1) Add site wide stylesheet to Default.Master
<head runat="server"> |
... |
<%Html.Telerik().StyleSheetRegistrar() |
.DefaultGroup(group => group.Add("~/Content/css/Site.css")).Render();%> |
.... |
</head> |
this outputs correctly:
<head> |
.... |
<link type="text/css" href="/Content/css/Site.css" rel="stylesheet"/> |
.... |
</head> |
2) Add a stylesheet to a specific page:
<% |
Html.Telerik().StyleSheetRegistrar().StyleSheets(css => css.Add("~/Content/css/Page.css")); |
%> |
but the new stylesheet never outputs in the HTML:
<head> |
.... |
<link type="text/css" href="/Content/css/Site.css" rel="stylesheet"/> |
.... |
</head> |
Can the StyleSheetRegistrar work like this?
Thanks
Karl