asp.net获取Repeater里面Button提交后的文本框的值

 protected void btnAddFJ_Click(object sender, EventArgs e)
        {
            Button bt = sender as Button;
            RepeaterItem rptItem = bt.Parent as RepeaterItem;
            TextBox txt = rptItem.FindControl("txtFJName") as TextBox;
            //ScriptManager.RegisterStartupScript(this.btnShow, this.GetType(), "myscript", "alert('" + txt.Text + "');", true);
            ScriptManager.RegisterStartupScript(this.btnShow, this.GetType(), "myscript", "navtabshow();", true);
        }
效果:

你可能感兴趣的:(asp.net获取Repeater里面Button提交后的文本框的值)