我在转发器中有一个按钮,用户可以看到其中的单击文本框,但是我有一个按钮列表,并且单击特定按钮文本框应该专门为该按钮打开,
目前,当我点击按钮时,所有文本框都会显示给用户。
这是守则......
<asp:Repeater ID="rpt">
<div align="right" id="reply">
<asp:LinkButton ID="lnkbtnreply" OnClick="lnkbtnreply_Click" Text="Reply"></asp:LinkButton>
</div>
<asp:TextBox ID="" placeholder="Enter Your Reply Here" Visible="false">
</asp:TextBox>
</asp:Repeater>
代码背后:
protected void lnkbtnreply_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in rptcomment.Items)
{
Panel replypic = (Panel)item.FindControl("replypic");
Panel replywrite = (Panel)item.FindControl("replywrite");
replypic.Visible = true; replywrite.Visible = true;
}
}