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
When I use this code it give the following errorsSyntax
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.
VB Code:
Dim i As Integer For i = 1 To Request.Form("txtDetails").count Response.Write(Request.Form("txtDetails")(i)) Response.Write("<br>") 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:
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?


Reply With Quote