How to get the HTML form element value in ASP.NET code behind page?

Raja
Posted by Raja under ASP.NET category on | Views : 13085
To get the HTML form element value in ASP.NET Code behind file, use following code snippet.

For example:
<input type="text" name="txtFirstName" />


To get the value of txtName textbox, write following line of code.

string firstName = Request.Form["txtFirstName"].ToString();


In the same, way hidden field and other html form elements value can be retrieved.

Thanks.

Comments or Responses

Login to post response