开发者

Possible To Set Control Properties Inside a Loop Without CodeBehind?

开发者 https://www.devze.com 2023-02-03 12:40 出处:网络
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

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

精彩评论

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