ASPX Form Process

Discussion in 'ASP .Net' started by =?Utf-8?B?QXJtYW5kbyBSdWl6?=, Nov 16, 2004.

  1. 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
     
    =?Utf-8?B?QXJtYW5kbyBSdWl6?=, Nov 16, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
     
    Ken Cox [Microsoft MVP], Nov 16, 2004
    #2
    1. Advertising

  3. Another way is shown here..

    http://msdn.microsoft.com/library/d...l/frlrfsystemwebhttprequestclassformtopic.asp

    "Armando Ruiz" <> wrote in message
    news:...
    > 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
     
    Ken Cox [Microsoft MVP], Nov 16, 2004
    #3
  4. 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" <> wrote in message
    > news:...
    > > 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

    >
    >
     
    =?Utf-8?B?QXJtYW5kbyBSdWl6?=, Nov 16, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rithesh Pai
    Replies:
    1
    Views:
    5,624
  2. walala
    Replies:
    3
    Views:
    769
    Allan Herriman
    Sep 9, 2003
  3. John M
    Replies:
    1
    Views:
    1,260
    Kumar Reddi
    May 29, 2005
  4. =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=

    How to rise aspx parent forms event from aspx Child form

    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    896
    S. Justin Gengo
    Oct 22, 2005
  5. Luiz Vianna

    Aspx Form --> ASP Form

    Luiz Vianna, Oct 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    136
    Luiz Vianna
    Oct 3, 2003
Loading...

Share This Page