If i call
var nvc = HttpUtility.ParseQueryString("?foo=bar&baz=robots")
I am returning a NameValueCollection where, if I call ToString on it, I am returning a query string.
var str = nvc.ToString();
If I create a new NameValueCollection, add material to it and call ToString () on it, I will not return the query string.
var nvc= new NameValueCollection();
nvc["foo"] = "bar";
var str = nvc.ToString();
There is also no way to build a NameValueCollection that acts as a query string editor. Is there any? If not, why? The ability to edit query strings is a pretty useful thing, but this functionality is completely hidden in obscure mode of some object that most people don’t even know.
source
share