Results 1 to 2 of 2

Thread: Need help retrieving values from the POST method.

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Need help retrieving values from the POST method.

    I’m having troubles getting values passed by the POST method. What I have is a web form that is build from an xml file and transformed using an xsl stylesheet. This give good results but when I submit the form I’m having trouble returning values when elements are repeated. According to MSDN the syntax for Request.Form is

    Syntax
    Request.Form(
    element)[(index)|.Count]
    Parameters
    element
    The name of the form element from which the collection is to retrieve values.
    index
    An optional parameter that enables you to access one of multiple values for a parameter. It can be any integer in the range 1 to Request.Form(parameter).Count.
    When I use this code it give the following errors
    VB Code:
    1. Dim i As Integer
    2.  
    3.         For i = 1 To Request.Form("txtDetails").count
    4.             Response.Write(Request.Form("txtDetails")(i))
    5.             Response.Write("<br>")
    6.         Next I

    I get this error on this line
    Request.Form("txtDetails").count ---------- 'count' is not a member of 'String'.

    And on this line I get this error.
    Request.Form("txtDetails")(i) ---------- Expression is not an array or a method, and cannot have an argument list.

    If I run this code it returns all the fields that I need as a comma separated list.
    VB Code:
    1. Response.Write(Request.Form("txtDetails"))

    I could live with this and just split the return on the commas but the field I return might already have commas in them so that will not work.

    What am I missing here?

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    System.String.Length not count
    Magiaus

    If I helped give me some points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width