开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜