repeater 的HeaderTemplate里面的label应该怎么动态赋值
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
repeater 的HeaderTemplate里面的label应该如何动态赋值?
<HeaderTemplate>
<table class="tablesorter" style="word-break:break-all;table-layout:fixed; font-size:20px;">
<thead>
<tr>
<th style="width:60px;"><asp:Label ID="Label1" runat="server"></asp:Label></th>
<th style="width:60px;"><asp:Label ID="Label2" runat="server"></asp:Label></th>
<th style="width:60px;"><asp:Label ID="Label3" runat="server"></asp:Label></th>
<th style="width:60px;"><asp:Label ID="Label4" runat="server"></asp:Label></th>
<th style="width:60px;"><asp:Label ID="Label5" runat="server"></asp:Label></th>
<th style="width:60px;"><asp:Label ID="Label6" runat="server"></asp:Label></th>
<th style="width:60px;"><asp:Label ID="Label7" runat="server"></asp:Label></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
------解决方案-------------------- protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { Label Label1 = e.Item.FindControl("Label1") as Label; Label1.Text = "xxx"; } } 该文章在 2017/10/26 17:21:34 编辑过 |
关键字查询
相关文章
正在查询... |