c# - How to mix server side code in razor -
a trivial question solution escapes me @ moment
we have cms layout , css ( names only, no extension ) retrieved db !
the .cshtml has code not compile cleanly
.... <link href="~/content/themes/@viewbag.dbconfig.theme/style/@viewbag.dbconfig.cssname.css" rel="stylesheet"> where variable
viewbag.dbconfig.cssname without .css extension
is there way make work without changing config ?
first wrap variable usages... see if yields more in line expected.
<link href="~/content/themes/@(viewbag.dbconfig.theme)/style/@(viewbag.dbconfig.cssname).css" rel="stylesheet">
Comments
Post a Comment