Tuesday, July 2, 2013

how to access values of the controls present inside the detailsview control | get value of the detailsview textbox field

here i will show how to access the values of the controls present inside the detailsview control like a textbox, label etc

Suppose inside the detailsview you have a textbox control and u want to access the value of it, then use this :

 string EmpName = ((TextBox)DetailsView1.FindControl("Emp_Name")).Text;

or u can use

 string s = DetailsView1.Rows[0].Cells[1].Text;

No comments:

Post a Comment