By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,629 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Posting from HTML Form to ASP.net

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.