Reputation: 932
<input id="tbxPopupCode" type="text" runat="server" value="<%= Request.QueryString["code"].Replace("-"," ") %>" />
I m getting an error:
Server tags cannot contain <% … %> constructs
I need to replace the value from Request.QueryString["code"]
and bind into textbox value.
Upvotes: 5
Views: 14831
Reputation: 3355
I know that it doesn't apply to this specific question, but I also received this error when I included the construct for an HTML tag attribute inside of a PlaceHolder control.
Upvotes: 1
Reputation:
Actually, the exception message is pretty clear:
You can not have runat="server"
and <%= %>
.
There are some workarouns for this (eg <%# %>
), but why not simply setting the value on the code-behind like this.tbxPopupCode.Value = ...
?
Upvotes: 17