I need to clear the queryString so I implemented an httpmodule
public void Init(HttpApplication context)
{
context.PostRequestHandlerExecute += newEventHandler(OnEndRequest);
}
and this is the method :
public void OnEndRequest(Object sender, EventArgs e)
{
HttpApplication context = (HttpApplication)sender;
if (HttpContext.Current.Request.QueryString != null && HttpContext.Current.Request.QueryString.Count != 0)
{ HttpContext.Current.Request.QueryString.Clear(); }
}
but it's giving an exception :
System.NotSupportedException was unhandled by user code
HResult=-2146233067
Message=Collection is read-only.