I want to get system.css of EpiServer. I searched some topic and I found this
But this code cannot work on MVC with razor engine and here is its error
'System.Web.Mvc.HtmlHelper' has no applicable method named 'CssLink' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
Could you help me how to get system.css in MVC Razor?
Thank in advance,
Can anyone help to solve this?
It seems lacking a @using to the namespace contains the extensions: EPiServer.Framework.Web.Mvc.Html
Did you tried to use: @Html.ShellCssLink("system.css")
or calling this as static method: @CssExtensions.ShellCssLink(Html, "system.css") ?
Thank for reply, your code have no error but it generated path"/EPiServer/Shell/22.214.171.124/system.css" which is not found. Existed system.css I want to get is "/App_Themes/Default/Styles/system.css"
I just used plain HTML tags for system.css (and ToolButton.css). Since they are under App_Themes they are not dependent on the version number, so should (hopefully) be OK after upgrading to new versions.
So I have
<link href="/App_Themes/Default/Styles/system.css" rel="stylesheet" />
<link href="/App_Themes/Default/Styles/ToolButton.css" rel="stylesheet" />
Works for me in CMS 126.96.36.199Happy to hear if there's a better solution for this.