Repeater 控件取其中其他控件的值

2024-12-25 07:27:19
推荐回答(1个)
回答1:

protected void Button1_Click(object sender, EventArgs e)
{
Button bt=(Button)sender;
RepeaterItem ri = (RepeaterItem)bt.Parent;
TextBox textbox = (TextBox)ri.FindControl("textBox1");
string txt=textbox.Text;//这个txt就是你要的值

}