Getting form field values

Discussion in 'ASP .Net' started by John, Oct 9, 2004.

  1. John

    John Guest

    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
    John, Oct 9, 2004
    #1
    1. Advertising

  2. John

    Alex Homer Guest

    <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


    "John" <> wrote in message
    news:...
    > 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
    >
    >
    Alex Homer, Oct 9, 2004
    #2
    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. Richard Dixson
    Replies:
    1
    Views:
    495
    Joe Fallon
    May 18, 2004
  2. Richard Dixson
    Replies:
    2
    Views:
    720
    Richard Dixson
    May 18, 2004
  3. NotGiven
    Replies:
    3
    Views:
    329
    Michael D. Kersey
    May 13, 2004
  4. GavMc
    Replies:
    4
    Views:
    308
    Evertjan.
    Sep 22, 2005
  5. NotGiven
    Replies:
    3
    Views:
    289
    Michael D. Kersey
    May 13, 2004
Loading...

Share This Page