且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

网格视图中文本框的访问值

更新时间:2023-10-19 18:04:16

向按钮Button1_Click添加一个事件,然后在该click事件中(气泡事件) )您可以找到控件

Add an event to the button Button1_Click then in that click event (bubble event) you can find the control

protected void Button1_Click(object sender, EventArgs e)
{
GridViewRow row=((Button)sender).Parent.Parent as GridViewRow;
TextBox t=(TextBox)row.FindControl("textbox ");
//t.Text - here is your value
}