replace values in the QueryString key/value pairs
October 14, 2009
The URL with a QueryString is something like “apage.aspx?month=10&year=2006&…”, anything in Request.QueryString cannot be changed because it is readonly, but the values of “month” and “year” can be changed as followed:
NameValueCollection nvc = HttpUtility.ParseQueryString(Request.QueryString.ToString());
nvc.Set(“month”, “12″);
nvc.Set(“year”, “2009″);
string newUrl = this.Request.ServerVariables["URL"].ToString() + “?” + nvc.ToString() ;
