post an html form onto asp.net

C

Carlo

I have an html form that posts onto an asp.net page (vs2005).

The form header is as follows: <form action="thankyou.aspx" method="post">.

In a table i have the fields <td><input id="email" type="text"
runat="server" /></td> and a submit button.

In the asp.net page, how do i get the values of the posted form ?

Thanks
 
M

Mark Rae

I have an html form that posts onto an asp.net page (vs2005).

The form header is as follows: <form action="thankyou.aspx"
method="post">.

In a table i have the fields <td><input id="email" type="text"
runat="server" /></td> and a submit button.

In the asp.net page, how do i get the values of the posted form ?

string strEmail = Request.Form["email"].ToString();
 
C

Carlo

It doesn't work. Request.Form["email"] is null



Mark Rae said:
I have an html form that posts onto an asp.net page (vs2005).

The form header is as follows: <form action="thankyou.aspx"
method="post">.

In a table i have the fields <td><input id="email" type="text"
runat="server" /></td> and a submit button.

In the asp.net page, how do i get the values of the posted form ?

string strEmail = Request.Form["email"].ToString();
 
C

Carlo

It doesn't work. Request.Form["email"] is null



Mark Rae said:
I have an html form that posts onto an asp.net page (vs2005).

The form header is as follows: <form action="thankyou.aspx"
method="post">.

In a table i have the fields <td><input id="email" type="text"
runat="server" /></td> and a submit button.

In the asp.net page, how do i get the values of the posted form ?

string strEmail = Request.Form["email"].ToString();
 
M

Mark Rae

It doesn't work. Request.Form["email"] is null

Apologies - you need a name property in your textbox tag e.g.

Mark Rae said:
I have an html form that posts onto an asp.net page (vs2005).

The form header is as follows: <form action="thankyou.aspx"
method="post">.

In a table i have the fields <td><input id="email" type="text"
runat="server" /></td> and a submit button.

In the asp.net page, how do i get the values of the posted form ?

string strEmail = Request.Form["email"].ToString();
 
S

Shkedy

Make sure your original form is properly coded.

To make sure the values are working You can check what values you are
submitting by running these few lines of code in the form load event:

Response.Write("Post variables: <br/>"); foreach (string key in
Request.Form) {

Response.Write(String.Format("{0} = {1} <br/>", key, Request.Form[key])); }
Response.Write("Get variables: <br/>"); foreach (string key in
Request.QueryString) {

Response.Write(String.Format("{0} = {1} <br/>", key,
Request.QueryString[key])); }

Sagi

Technical Blog

http://blog.shkedy.com
 
S

Shkedy

Sorry lines were messed up:

Response.Write("Post variables: <br/>");
foreach (string key in Request.Form)
{
Response.Write(String.Format("{0} = {1} <br/>", key,
Request.Form[key]));
}

Response.Write("Get variables: <br/>");
foreach (string key in Request.QueryString)
{
Response.Write(String.Format("{0} = {1} <br/>", key,
Request.QueryString[key]));
}




Shkedy said:
Make sure your original form is properly coded.

To make sure the values are working You can check what values you are
submitting by running these few lines of code in the form load event:

Response.Write("Post variables: <br/>"); foreach (string key in
Request.Form) {

Response.Write(String.Format("{0} = {1} <br/>", key,
Request.Form[key])); } Response.Write("Get variables: <br/>"); foreach
(string key in Request.QueryString) {

Response.Write(String.Format("{0} = {1} <br/>", key,
Request.QueryString[key])); }

Sagi

Technical Blog

http://blog.shkedy.com
I have an html form that posts onto an asp.net page (vs2005).

The form header is as follows: <form action="thankyou.aspx"
method="post">.

In a table i have the fields <td><input id="email" type="text"
runat="server" /></td> and a submit button.

In the asp.net page, how do i get the values of the posted form ?

Thanks
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top