views:

279

answers:

1

.Net's System.Web.HttpUtility class defines the following function to parse a query string into a NameValueCollection:

public static NameValueCollection ParseQueryString(string query);

Is there any function to do the reverse (i.e. to convert a NameValueCollection into a query string)?

+1  A: 

I don't think there is a built in one, but here is an example of how to implement http://blog.leekelleher.com/2008/06/06/how-to-convert-namevaluecollection-to-a-query-string/

Jonathan