test
test

Reputation: 23

How to pass values from html page to .aspx page?

i have

<input type ="text" id ="ID" value="" />
<input type ="text" id="Name" value ="" />
<input type="button" id="Submit" name="Submit"  value="Submit" size ="45" />

when i click Submit button to pass values to .aspx page.

Upvotes: 0

Views: 4837

Answers (2)

Michael
Michael

Reputation: 20049

If you post a form to an aspx page you can get the submitted values through the Request.Form collection. From your example:

You'll need to set the action on your form to the aspx page:

<form action="mypage.aspx">

And set the name on your field:

<input type ="text" name="ID" id="ID" value="" />

You can get them on the aspx with:

string id = Request.Form["ID"];

Upvotes: 4

Adriaan Stander
Adriaan Stander

Reputation: 166336

Have you tried something like

<input type ="text" id ="ID" value="" runat="server"/>

Have a look at ASP.NET - Server Controls

Upvotes: 0

Related Questions