remove QueryString

Sep 20 2014 5:41 AM
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");
}

Answers (1)