Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASPX Form Process

Reply
Thread Tools

ASPX Form Process

 
 
=?Utf-8?B?QXJtYW5kbyBSdWl6?=
Guest
Posts: n/a
 
      11-16-2004
If I have the following:
<HTML>
<FORM ACTION="http://mySite/sample.aspx" METHOD="POST">
Enter your name: <INPUT NAME="FName"><BR>
Favorite Ice Cream Flavor:
<SELECT NAME="Flavor">
<OPTION VALUE="Chocolate">Chocolate
<OPTION VALUE="Strawberry">Strawberry
<OPTION VALUE="Vanilla" SELECTED>Vanilla
</SELECT>
<P><INPUT TYPE=SUBMIT>
</FORM>
</HTML>

How do I retrieve the form values sent to sample.aspx in code??

Any help is appreciated...
--

AR
 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      11-16-2004
Hi Armando,

Try this in sample.aspx:

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim strFname As String
Dim strFlavor As String
strFlavor = Request.Form.Item("Flavor")
strFname = Request.Form.Item("FName")
Label1.Text = strFlavor & ":" & strFname
End If
End Sub

Does this help?

Ken
Microsoft MVP [ASP.NET]

"Armando Ruiz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If I have the following:
> <HTML>
> <FORM ACTION="http://mySite/sample.aspx" METHOD="POST">
> Enter your name: <INPUT NAME="FName"><BR>
> Favorite Ice Cream Flavor:
> <SELECT NAME="Flavor">
> <OPTION VALUE="Chocolate">Chocolate
> <OPTION VALUE="Strawberry">Strawberry
> <OPTION VALUE="Vanilla" SELECTED>Vanilla
> </SELECT>
> <P><INPUT TYPE=SUBMIT>
> </FORM>
> </HTML>
>
> How do I retrieve the form values sent to sample.aspx in code??
>
> Any help is appreciated...
> --
>
> AR


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      11-16-2004
Another way is shown here..

http://msdn.microsoft.com/library/de...sformtopic.asp

"Armando Ruiz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If I have the following:
> <HTML>
> <FORM ACTION="http://mySite/sample.aspx" METHOD="POST">
> Enter your name: <INPUT NAME="FName"><BR>
> Favorite Ice Cream Flavor:
> <SELECT NAME="Flavor">
> <OPTION VALUE="Chocolate">Chocolate
> <OPTION VALUE="Strawberry">Strawberry
> <OPTION VALUE="Vanilla" SELECTED>Vanilla
> </SELECT>
> <P><INPUT TYPE=SUBMIT>
> </FORM>
> </HTML>
>
> How do I retrieve the form values sent to sample.aspx in code??
>
> Any help is appreciated...
> --
>
> AR


 
Reply With Quote
 
=?Utf-8?B?QXJtYW5kbyBSdWl6?=
Guest
Posts: n/a
 
      11-16-2004
Thanks Ken, it did help a lot.

"Ken Cox [Microsoft MVP]" wrote:

> Hi Armando,
>
> Try this in sample.aspx:
>
> Private Sub Page_Load _
> (ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles MyBase.Load
> If Not IsPostBack Then
> Dim strFname As String
> Dim strFlavor As String
> strFlavor = Request.Form.Item("Flavor")
> strFname = Request.Form.Item("FName")
> Label1.Text = strFlavor & ":" & strFname
> End If
> End Sub
>
> Does this help?
>
> Ken
> Microsoft MVP [ASP.NET]
>
> "Armando Ruiz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > If I have the following:
> > <HTML>
> > <FORM ACTION="http://mySite/sample.aspx" METHOD="POST">
> > Enter your name: <INPUT NAME="FName"><BR>
> > Favorite Ice Cream Flavor:
> > <SELECT NAME="Flavor">
> > <OPTION VALUE="Chocolate">Chocolate
> > <OPTION VALUE="Strawberry">Strawberry
> > <OPTION VALUE="Vanilla" SELECTED>Vanilla
> > </SELECT>
> > <P><INPUT TYPE=SUBMIT>
> > </FORM>
> > </HTML>
> >
> > How do I retrieve the form values sent to sample.aspx in code??
> >
> > Any help is appreciated...
> > --
> >
> > AR

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
<form>...</form> - how to supress blank space after </form> in IE? rob c Javascript 4 12-30-2005 06:10 PM
How to rise aspx parent forms event from aspx Child form =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?= ASP .Net 1 10-22-2005 02:03 PM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
Aspx Form --> ASP Form Luiz Vianna ASP .Net Web Controls 0 10-02-2003 11:21 PM



Advertisments