How to get values from Textbox which is in Gridview Footer in C#?

 Posted by vishalneeraj-24503 on 1/2/2015 | Category: ASP.NET Interview questions | Views: 1531 | Points: 40
Answer:

Inside our GridView_RowCommand Event,we can access the footer control by GridView1.FooterRow.FindControl method .

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)

{
if (e.CommandName.Equals("Insert", StringComparison.OrdinalIgnoreCase))
{
TextBox txt_emp_id = ((TextBox)GridView1.FooterRow.FindControl("txt_emp_id"));
string emp_id = txt_emp_id.Text;
}
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response