title: Convert a Dictionary to string of url parameters?
body: <p>Is there a way to convert a Dictionary in code into a url parameter string?</p>
  
  <p>e.g. </p>
  
  <pre><code>// An example list of parameters
  Dictionary&lt;string, object&gt; parameters ...;
  foreach (Item in List)
  {
      parameters.Add(Item.Name, Item.Value);
  }
  
  string url = "http://www.somesite.com?" + parameters.XX.ToString();
  </code></pre>
  
  <p>Inside MVC HtmlHelpers you can generate URLs with the UrlHelper (or Url in controllers) but in Web Forms code-behind the this HtmlHelper is not available.</p>
  
  <pre><code>string url = UrlHelper.GenerateUrl("Default", "Action", "Controller", 
      new RouteValueDictionary(parameters), htmlHelper.RouteCollection , 
      htmlHelper.ViewContext.RequestContext, true);
  </code></pre>
  
  <p>How could this be done in C# Web Forms code-behind (in an MVC/Web Forms app) without the MVC helper?</p>