Reading HTML form post in ASP.Net

  • Thread starter Sergey Poberezovskiy
  • Start date
S

Sergey Poberezovskiy

Hi,

I am trying to read form values from HTML form in ASP.Net.
For example:

first.html file
<html><body><form action="second.aspx" method="post">
<input type=text id="txtOne" />
<input type=submit value=OK />
</form></body></html>

second.aspx file code (I use VB):
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
Console.Write(Me.Request.Form("txtOne"))
End Sub

The Form collection of the page.Request is EMPTY!!!

Could someone please help?

Any suggestions/directions are very much appreciated.
 
M

Martin Honnen

Sergey Poberezovskiy wrote:

I am trying to read form values from HTML form in ASP.Net.
For example:

first.html file
<html><body><form action="second.aspx" method="post">
<input type=text id="txtOne" />

An input element needs a name attribute to be submitted:
<input type="text" name="txtOne">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top