473,508 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Posting from HTML Form to ASP.net

Hello!

I need to retrieve POST information from an HTML form into my VB ASP.net
2008 web form.

My simple html form is:
<form action="webform1.aspx" method="post" name="Form1">
<input id="txtDBSearch" type="text" />
<input id="Submit1" type="submit" value="submit" /></form>
My simple asp.net web form code is

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Label1.Text = Request("txtDBSearch")
End Sub

However, this code does not work. If I enter something in the field in the
HTML page and submit it, then breakpoint the label1.text line, and in the
immediate window I type:

? request.form.count

it returns 0.

Nothing seems to work. If any one can help I would appreciate it.

Thanks !!

Oct 30 '08 #1
2 7998

Hi Cory -

You've simply got your domains confused. :-)

You must include the name attribute in your input tags. HTML forms don't
submit data using the id attribute.

Try--

<input name="txtDBSearch" type="text" />
<input name="Submit1" type="submit" value="submit" /></form>

Best Regards,

-Mark
"Cory J. Laidlaw, Beyond01.com"
<Co*********************@discussions.microsoft.com wrote in message
news:A0**********************************@microsof t.com...
Hello!

I need to retrieve POST information from an HTML form into my VB ASP.net
2008 web form.

My simple html form is:
<form action="webform1.aspx" method="post" name="Form1">
<input id="txtDBSearch" type="text" />
<input id="Submit1" type="submit" value="submit" /></form>
My simple asp.net web form code is

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Label1.Text = Request("txtDBSearch")
End Sub

However, this code does not work. If I enter something in the field in the
HTML page and submit it, then breakpoint the label1.text line, and in the
immediate window I type:

? request.form.count

it returns 0.

Nothing seems to work. If any one can help I would appreciate it.

Thanks !!
Oct 30 '08 #2
Mark,

Well, now I just feel Silly! :)

Your advice worked great! Thanks a mil!

Cory

"Mark S. Milley" wrote:
>
Hi Cory -

You've simply got your domains confused. :-)

You must include the name attribute in your input tags. HTML forms don't
submit data using the id attribute.

Try--

<input name="txtDBSearch" type="text" />
<input name="Submit1" type="submit" value="submit" /></form>

Best Regards,

-Mark
"Cory J. Laidlaw, Beyond01.com"
<Co*********************@discussions.microsoft.com wrote in message
news:A0**********************************@microsof t.com...
Hello!

I need to retrieve POST information from an HTML form into my VB ASP.net
2008 web form.

My simple html form is:
<form action="webform1.aspx" method="post" name="Form1">
<input id="txtDBSearch" type="text" />
<input id="Submit1" type="submit" value="submit" /></form>
My simple asp.net web form code is

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Label1.Text = Request("txtDBSearch")
End Sub

However, this code does not work. If I enter something in the field in the
HTML page and submit it, then breakpoint the label1.text line, and in the
immediate window I type:

? request.form.count

it returns 0.

Nothing seems to work. If any one can help I would appreciate it.

Thanks !!
Oct 31 '08 #3

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

Similar topics

6
3242
by: Jochen Daum | last post by:
Hi ! If I have an input field <form ... method="post"> <input type="text" name="abc def"> </form>
1
2273
by: Chris Lasher | last post by:
Hello, I'm trying to write a tool to scrape through some of the Ribosomal Database Project II's (http://rdp.cme.msu.edu/) pages, specifically, through the Hierarchy Browser....
10
4158
by: DaveFash | last post by:
Posting variables from an HTML FORM, via the Request.Form function on the receiving ASP page is great. But how can you POST a Form variable to an ASP page -- without a human pushing a Submit...
13
2723
by: Ian.Suttle | last post by:
I am have been researching this issue to no end, so any help would be very much appreciated. I have a page with form tags. Inside of the form tags is a panel that contains a user control. The...
2
2249
by: Esa | last post by:
Hi, I'm having problems with one strange web system where submitting an application and making queries about its handling status require a series of form submits and response parsing - all in...
2
6982
by: Peter2 | last post by:
Hi, I have a problem posting non-ASCII characters in FORM fields between classic ASP and ASP.NET. I use a fully patched Windows 2000 Advanced Server with .net 2.0 and visual Studio 2005 installed,...
1
54452
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
0
2540
by: sharif | last post by:
Anyone could help me out for n=my code ......I have written following code ,Here i m able to get and post the form successfuly..but after posting im not gettng proper response content... ...
5
2702
by: Otto Wyss | last post by:
It's possible to declare inbut fields outside of a form, is it possible to post these values to the server? E.g. attach them to the posted form? O. Wyss
3
1741
by: scripteaze | last post by:
posting to a form with no form name or it's just that i cant find the form name. can anyone explain how to either post to a form with no name or, find the name of the form..here my current output,...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.