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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -