Getting form field values

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is there an asp.net equivalent of the following code in the context of a
form?

for i = 1 to Request.Form.Count
strMsgInfo = strMsgInfo & Request.Form.Key(i) & ": " &
Request.Form.Item(i) & vbCrLf & vbCrLf
next

Thanks

Regards
 
<asp:Label id="lblRequest" runat="server" />

Then, in the Page_Load event handler:

' display the values in the Request collections
lblRequest.Text &= "* QueryString collection:<br />"
For Each oValue As String In Request.QueryString
lblRequest.Text &= "&nbsp; " & oValue & " = " _
& Request.QueryString(oValue) & "<br />"
Next
lblRequest.Text &= "* Form collection:<br />"
For Each oValue As String In Request.Form
lblRequest.Text &= "&nbsp; " & oValue & " = " _
& Request.Form(oValue) & "<br />"
Next
 
Back
Top