Tuesday 17 March 2015

How to get textbox value in WebForm

Here code to get textbox value in Webform, may we want to insert some data to database.
string id_kelas = Server.HtmlEncode(txtIdKelas.Text);

txtIdKelas is the ID of the textbox

Or may you want to update a single row and you want to get the value
string id_kelas = ((TextBox)gridviewKelas.Rows[e.RowIndex].FindControl("txtIdKelas")).Text;

:D

No comments:

Post a Comment