473,382 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

post an html form onto asp.net

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" /></tdand a submit button.

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

Thanks
Jan 20 '07 #1
6 1808
"Carlo" <ca***@vivo.comwrote in message
news:uH**************@TK2MSFTNGP05.phx.gbl...
>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" /></tdand a submit button.

In the asp.net page, how do i get the values of the posted form ?
string strEmail = Request.Form["email"].ToString();
Jan 20 '07 #2
It doesn't work. Request.Form["email"] is null

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"Carlo" <ca***@vivo.comwrote in message
news:uH**************@TK2MSFTNGP05.phx.gbl...
>>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" /></tdand a submit button.

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

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

Jan 20 '07 #3
"Carlo" <ca***@vivo.comwrote in message
news:uY**************@TK2MSFTNGP02.phx.gbl...
It doesn't work. Request.Form["email"] is null
Apologies - you need a name property in your textbox tag e.g.

<input type="text" id="email" name="email" />
>
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>"Carlo" <ca***@vivo.comwrote in message
news:uH**************@TK2MSFTNGP05.phx.gbl...
>>>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" /></tdand a submit button.

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

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


Jan 20 '07 #4
It doesn't work. Request.Form["email"] is null

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"Carlo" <ca***@vivo.comwrote in message
news:uH**************@TK2MSFTNGP05.phx.gbl...
>>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" /></tdand a submit button.

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

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

Jan 20 '07 #5
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" /></tdand a submit button.

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

Thanks

Jan 22 '07 #6
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" <sh****@newsgroups.nospamwrote in message
news:eV**************@TK2MSFTNGP03.phx.gbl...
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" /></tdand a submit button.

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

Thanks


Jan 22 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
1
by: JohnathanKong | last post by:
Hello, I hope this is the right place to post, but anyways, here goes. I current have a forum, snitz, in place, but am having an IE specific problem. Basically what happens is, I have a page that...
0
by: =?Utf-8?B?Sm9obmF0aGFuS29uZw==?= | last post by:
Hello, I hope this is the right place to post, but anyways, here goes. I current have a forum, snitz, in place, but am having an IE specific problem. Basically what happens is, I have a page that...
3
by: Jag | last post by:
Hi I am facing a strange issue. I have 3 ASP pages in the default website 1. auth.aspx <html> <body>
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.