ASPX Form Process

G

Guest

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...
 
K

Ken Cox [Microsoft MVP]

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]
 
G

Guest

Thanks Ken, it did help a lot.

Ken Cox said:
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]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top