ASP.Net selecting a stylesheet based on a variable
Posted on 2013-12-17
I have an ASP.Net website with a masterpage containing the following line in its head:
<link href="/Style/base.css" rel="stylesheet" type="text/css" />
There is also a variable called SiteId which is assigned a value in Sub Page_Init
Now, instead of picking the base.css file in the /Style directory, I want to pick up base.css in /Style/<SiteId>
I have tried:
<link href="/Style/<%= SiteId %>/base.css" rel="stylesheet" type="text/css" />
but this doesn't work.
How do I do this?