Popular Posts

Friday, November 16, 2012

Easy way to create query string

Not sure why this class is not publicly available?? You have to access it using the HTTPUtility.ParaseQueryString. The cool thing is that it returns encoded URL... This prints: Name=Rahman+Mahmoodi&Location=Sydney+Australia

Code Snippet
  1.        var col = System.Web.HttpUtility.ParseQueryString(string.Empty);
  2.             col.Add("Name", "rahman mahmoodi");
  3.             col.Add("Location", "Sydney Australia");
  4.  
  5.             MessageBox.Show(col.ToString());

No comments:

Post a Comment