Posting from HTML page

  • Thread starter Thread starter Steve Peterson
  • Start date Start date
S

Steve Peterson

Hello

I have a problem with posting from a .htm page to a .aspx page. In the
"normal" .htm page I have a standard post form and input button. The form
action attribute is set to the .aspx page
(action="http://localhost/Mysite/Input.aspx). I press the submit button and
the Input.aspx is loaded fine. However, there are no Request.Form variables
passed to .aspx page. In the Page_Load method of the Input.aspx, I added a
little test code:

Response.Write(Request.Form("UserName") ["USerName" is the id of an htm
text box in the .htm page]

And I get Nothing. I looked at the Request.Form.Keys.Count property and it
is 0.

Why is this? Any help is greatly appreciated!

Steve

I am on VS 2005 running ASP.NET 2.0
 
Julian - thanks for the reply! Your suggestion helped me track down what was
wrong. Sigh.... A very STUPID oversight on my part. I'm so used to working
with .NET server controls and using the "id" parameter and code behind that
I forgot that when using HTML input tags you need the "name" attribute.

I had:

<input id="txtName" type="text" >

I needed:

<input id="txtName" type="text" name="UserName">

Sigh........

Steve
 
Back
Top