repeater里获取label
<FooterTemplate><asp:LabelID="isnull"Visible="false"runat="server"><tr><tdclass="ntdb...
<FooterTemplate>
<asp:Label ID="isnull" Visible="false" runat="server">
<tr>
<td class="ntdbg" colspan="5" style="height:30px; padding-left:30px;">暂无</td>
</tr>
</asp:Label>
<tr>
<td class="ntdbg" colspan="5" style="height:30px; padding-left:30px;">
<asp:Button ID="allupdate" runat="server" Text="更新所有" CssClass="btn" OnClick="allupdate_Click" />
<asp:Button ID="checkdel" runat="server" Text="删除所选" CssClass="btn" OnClick="checkdel_Click" />
<asp:Button ID="checkshow" runat="server" Text="显示/不显示所选" CssClass="btn" OnClick="checkshow_Click" />
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
//暂无
Label isnull = (Label)Cate.FindControl("isnull");
if(isnull!=null)
{
if (Cate.Items.Count > 0)
{
isnull.Visible = false;
}
else
{
isnull.Visible = true;
}
}
为什么获取不到Label
还要foreach吗? 阿 倒
if (e.Item.ItemType == ListItemType.Item)
e.Item.ItemType打不出来啊,提示里没有啊???
编译不过去呀?? 展开
<asp:Label ID="isnull" Visible="false" runat="server">
<tr>
<td class="ntdbg" colspan="5" style="height:30px; padding-left:30px;">暂无</td>
</tr>
</asp:Label>
<tr>
<td class="ntdbg" colspan="5" style="height:30px; padding-left:30px;">
<asp:Button ID="allupdate" runat="server" Text="更新所有" CssClass="btn" OnClick="allupdate_Click" />
<asp:Button ID="checkdel" runat="server" Text="删除所选" CssClass="btn" OnClick="checkdel_Click" />
<asp:Button ID="checkshow" runat="server" Text="显示/不显示所选" CssClass="btn" OnClick="checkshow_Click" />
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
//暂无
Label isnull = (Label)Cate.FindControl("isnull");
if(isnull!=null)
{
if (Cate.Items.Count > 0)
{
isnull.Visible = false;
}
else
{
isnull.Visible = true;
}
}
为什么获取不到Label
还要foreach吗? 阿 倒
if (e.Item.ItemType == ListItemType.Item)
e.Item.ItemType打不出来啊,提示里没有啊???
编译不过去呀?? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询