title: How to remove query string parameters from the url?
body: <p>Assume I have the link <a href="http://www.somesite.com/file.aspx?a=1&amp;b=2" rel="nofollow noreferrer">http://www.somesite.com/file.aspx?a=1&amp;b=2</a></p>
  
  <p>And now I want to remove all the parameters, so it becomes:</p>
  
  <p><a href="http://www.somesite.com/file.aspx" rel="nofollow noreferrer">http://www.somesite.com/file.aspx</a></p>
  
  <p>Or I may want to remove only 1 of the parameters such as</p>
  
  <p><a href="http://www.somesite.com/file.aspx?b=2" rel="nofollow noreferrer">http://www.somesite.com/file.aspx?b=2</a></p>
  
  <p>Is there a way to do the above in C#?  What is happening is that I am coming from another page with a parameter called edit in the url, but when the page does a post back, the edit parameter is still there, so it still thinks it is in edit mode.  Example:</p>
  
  <p>User A goes to page one.aspx and clicks on an edit link.  They are taken to two.aspx?edit=true.  During page load, it sees the the query string parameter edit is not null and it puts the contents in edit mode.  Once the user is done editing, the page is refreshed, but the url is still two.aspx?edit=true and keeps the contents in edit mode, when in fact it should be two.aspx</p>