0

I've looked all over, and I can't find a solution for this. Correction: I find solutions, but they (I can't make them) work.

I'm passing an array to an HttpHandler via the query string. I've read that you read it this way:

Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

    Dim request As HttpRequest = context.Request

    For u = 0 To request.QueryString("arrayIneed").Count - 1
        selectPONumber.Add(request.QueryString("arrayIneed")(u))
    Next

Doing this, regardless of whether the query string format is arrayIneed=data1,data2... or arrayIneed=[data1,data2...], chops everything after = into single values.

Please help. Many thanks in advance!

1 Answer 1

2
request.QueryString("arrayIneed") 

will just pull a string out if you need it as an array then you will need to split it into one

 dim arr = Request.QueryString("arrayINeed").Split(",")
 For Each s In arr
    selectPoNumber.Add(s)
 Next

worth noting that if your po number array is one of integers, you will have to convert s into an int

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.