protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string[] s = new string[] { "1", "2", "3", "4", "5" };
this.rptTest.DataSource = s;
this.rptTest.DataBind();
}
}
protected void TestBtn(object sender, EventArgs e)
{
Button bt = sender as Button;
RepeaterItem ri = bt.Parent as RepeaterItem;
TextBox tx = ri.FindControl("txt") as TextBox;
if (!object.Equals(tx, null))
{
Response.Write(tx.Text);
}
}
请发表评论