Handling arrays in request.querystring (c#)

  • Thread starter Thread starter Matthew Thompson
  • Start date Start date
M

Matthew Thompson

I am developing an application which allows users to choose multiple
text sections from a list, displayed as a CheckBoxList, for printing.

The sections are being passed to a page using the QueryString and as
such I am getting a URL similar to the following created...

http://localhost/doprint.aspx?pid=1462?pa=ovr&pa=arr&pa=bth&pa=gen

Pid is a unique identifier for the entity which the text sections are
related to and pa is a list of text sections to be printed.

In Classic ASP getting these out in order was fairly simple but there
seems to be a bewildering array of methods to attack the
Request.QueryString object.

Ideally I'd like to end up with a comma seperated list or array of the
values assigned the the "pa" array.

Can anyone offer assistance? I'm writing in C#.

M@t :o)
 
Request.QueryString.GetValues("pa") will return array of string

HTH

Thanks - this worked great - shame you can't just foreach through
Request.QueryString.GetValues("pa")! Are you listening Microsoft :o)

M@t :o)
 
Back
Top