namevaluecollection

NameValueCollection to URL Query?

I know i can do this var nv = HttpUtility.ParseQueryString(req.RawUrl); But is there a way to convert this back to a url? var newUrl = HttpUtility.Something("/page", nv); ...

How to set the length of NameValueCollection

Hi, I am a newbie in C# (not in programming). Please, what is the simplest way to decrease items count in NameValueCollection object? For example I have 13 name-value pairs in collection and I want to cut it to the first 5. Do I really have to do it in a loop? thanx ...

How to Modify HTTP Header of a request using C#?

Hi, I was trying to modify a HTTP Header using C#. I tried to manipulate the Request.Headers on Page preinit event. But when i try to set anything to the Headers, i get PlatformNotSupportedException. Since We can not set a new NameValueCollection to Reqeust.Headers, I tried to set the value using following code: Request.Headers.Set(Htt...