Adding or Replacing a Page item in a QueryString in C#.
I think that yes this code can be improved.

use a regular expression:

            var newQuery = Regex.Replace(currentQuery, @"(?i)(page=\d*&amp;?)", "").TrimEnd('&amp;');
            if (newQuery.Length &gt; 0)
                newQuery += string.Format("&amp;Page={0}", currentPageNo);
            else
                newQuery = string.Format("Page={0}", currentPageNo);