Request.QueryString.Remove("editFlag")
If you do the above, you will get an error
collection is read-only.
So, we need to write the below code before deleting the query string.
Try this way
PropertyInfo isreadonly =
typeof(System.Collections.Specialized.NameValueCollection).GetProperty(
"IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
// make collection editable
isreadonly.SetValue(this.Request.QueryString, false, null);
// remove
this.Request.QueryString.Remove("editFlag");
You can also try this way
var nvc = HttpUtility.ParseQueryString(Request.Url.Query);
nvc.Remove("editFlag");
string url = Request.Url.AbsolutePath + "?" + nvc.ToString();
Response.Redirect(url);
Hope this helps