what this code not remove Query String ?
protected void Page_Load(object sender, EventArgs e)
{
// Get the NameValueCollection
PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
// make collection editable
isreadonly.SetValue(this.Request.QueryString, false, null);
// remove
Request.QueryString.Remove("b");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Default.aspx?b=123");
}

Riddhi ValechaPosted Sep 22, 2014, 8:13 AM
I would suggest that you use Session Variables for Passing values between pages.
Query String method is old and we as IT People can see the value in the URL also.
Also, these sites are more vulnerable and are security-wise not very safe.