I have to discriminate some page elements (image, css, …) on the base of what a user choose at the first page.
I use <%=Expression%> like this:
<img id="imgBackground" src='<%= this.GetLinkBasedOnUser("img/background1.jpg") %>' />
The method GetLinkBasedOnUser do a simple string concatenation.
I like this way because I’m try to keep the “user interface” separate from the code.
BUT…
<link href="<%= this.GetLinkBasedOnUser('css/cssStyle1.css') %>" rel="stylesheet" type="text/css" />
try this :
strings in c# requires having
"as string delimiters, not'(char)