C# .net Repeater里的控件后台调用 Repeater 里有个panel 还有个LinkButton panel 默认是隐藏的,现在要点击LinkButton让Panel显示出来,怎么实现?Repeater里的服务器控件在后台怎么取得ID? 我是新手,请勿嘲笑! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --前台<asp:Repeater ID="rpt" runat="server" onitemcommand="rpt_ItemCommand"> <ItemTemplate> <asp:LinkButton ID="lb" runat="server" Text="test"></asp:LinkButton> <asp:Panel ID="p" runat="server" Visible="false">xxxx</asp:Panel> <asp:Label ID="lblid" runat="server"></asp:Label> </ItemTemplate> </asp:Repeater>--后台 protected void rpt_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.Item.FindControl("p") != null) { ((Panel)e.Item.FindControl("p")).Visible = true; //取ID,e.Item.FindControl("p")你查找的p本身就是一个id ((Label)e.Item.FindControl("lblid")).Text = ((Panel)e.Item.FindControl("p")).ID.ToString(); } } 高分求一正則表達式 DATATABLE转换为LIST 请赐教:如何知道某个类的 Instance 已经实际存在了。 TEXTBOX更新问题,我先赋值了一次然后再修改为什么获取得值还是之前个?大侠帮忙吖!! VB里怎样调用C#写的dll 准备发起一个开源的CMS项目,有兴趣的联系我 c#使用api如何改变exe程序的主题样式 关于鼠标拖动的小问题。 如何在asp.net的DataGrid中修改数据时,使DataGrid的一列变成下拉列表框的样式? 成立虚拟小团队,开发自己的东西!有兴趣进来看看 考勤查询SQL语句怎么写 想做个小工具,请教winform与windows服务
<ItemTemplate>
<asp:LinkButton ID="lb" runat="server" Text="test"></asp:LinkButton>
<asp:Panel ID="p" runat="server" Visible="false">xxxx</asp:Panel>
<asp:Label ID="lblid" runat="server"></asp:Label>
</ItemTemplate>
</asp:Repeater>--后台 protected void rpt_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.Item.FindControl("p") != null)
{
((Panel)e.Item.FindControl("p")).Visible = true;
//取ID,e.Item.FindControl("p")你查找的p本身就是一个id
((Label)e.Item.FindControl("lblid")).Text = ((Panel)e.Item.FindControl("p")).ID.ToString();
}
}