Possible To Set Control Properties Inside a Loop Without CodeBehind?
Is it possible to set properties of an control inside a loop without using code behind? For example how can I set the Text
property of the LinkButton
inside the following loop at runtime, color being a POCO?
<table>
<%foreach (var color in GetColors()) {%>
<tr>
<td><asp:LinkButton runat="server" Text='<%# ??color.MyProperty?? %>' /></td> 开发者_如何学JAVA
</tr>
<%}%>
</table>
you can use repeater to bind the output from GetColors() to the control.
精彩评论