How to remove query string in asp.net
Solved
Request.QueryString.Remove("Parameter-Name") just run the program only this code it showing the read only error.
use the below code 100% working
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("Parameter-Name");
Request.QueryString.Remove("Parameter-Name") just run the program only this code it showing the read only error.
use the below code 100% working
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("Parameter-Name");
Comments
Post a Comment