post an html form onto asp.net

  • Thread starter Thread starter Carlo
  • Start date Start date
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
 
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();
 
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();
 
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();
 
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();
 
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
 
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
 
Back
Top