mko
mko

Reputation: 7325

Setting values with commas in namevaluecollection

I am using the following code to access and manipulate query string

NameValueCollection qs = HttpUtility.ParseQueryString(Request.Url.Query);
qs.Set("OID", "5,6,7");
Response.Redirect( absolutepath + "?" + qs);

The problem is that query string ends up like this "something.aspx?OID=5%2c6%2c7" instead of something.aspx?OID=5,6,7

How can I format qs to get commas instead of %2c?

Upvotes: 1

Views: 656

Answers (1)

Apurv Gupta
Apurv Gupta

Reputation: 860

Use HttpUtility.UrlDecode(qs);

Upvotes: 2

Related Questions