开发者

From inside a repeaters itemtemplate, how to set a input type (image) controls title attribute?

开发者 https://www.devze.com 2023-03-26 21:31 出处:网络
In my c# code, I have a constant: SITE_NAME = \"my site\"; I have a repeater control, and inside the itemtemplate I have a input control:

In my c# code, I have a constant:

SITE_NAME = "my site";

I have a repeater control, and inside the itemtemplate I have a input control:

<input开发者_如何学JAVA type=image runat=server title="<%= SITE_NAME %>" />

Do I need special syntax to set this value? It isn't rendering the string "my site", rather it is rending:

<%= SITE_NAME %>

i.e. it isn't parsing it as c# code.


When working within a databound template, use <%# %> instead of <%= %>

0

精彩评论

暂无评论...
验证码 换一张
取 消