Change Single URL query string value
<p>I have an ASP.NET page which takes a number of parameters in the query string:</p>

<pre><code>search.aspx?q=123&amp;source=WebSearch
</code></pre>

<p>This would display the first page of search results.  Now within the rendering of that page, I want to display a set of links that allow the user to jump to different pages within the search results.  I can do this simply by append <code>&amp;page=1</code> or <code>&amp;page=2</code> etc.</p>

<p>Where it gets complicated is that I want to preserve the input query string from the original page for every parameter except the one that I'm trying to change.  There may be other parameters in the url used by other components and the value I'm trying to replace may or may not already be defined:</p>

<pre><code>search.aspx?q=123&amp;source=WebSearch&amp;page=1&amp;Theme=Blue
</code></pre>

<p>In this case to generate a link to the next page of results, I want to change <code>page=1</code> to <code>page=2</code> while leaving the rest of the query string unchanged.</p>

<p>Is there a builtin way to do this, or do I need to do all of the string parsing/recombining manually?</p>
