The stylesheet for my website can vary for every user. So the name of the css file is read from the database. I set the css name in ViewBag.StyleSheet and set it in my Razor file like this:
@section Scripts {
<link href="@Url.Content("~/Content/@ViewBag.StyleSheet.css")" rel="stylesheet" type="text/css" />
}
But this is not working. Please help.
Url.Contentis a normal C# function call that takes a normal string.You need to concatenate that string, like this: