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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -