I wrote this code :
public class DenyAccessforNonAuthorizedURL : IHttpModule { public void Dispose() { //clean-up code here. } public void Init(HttpApplication context) { context.PostRequestHandlerExecute += new EventHandler(OnPreRequestHandlerExecute); } public void OnPreRequestHandlerExecute(Object sender, EventArgs e) { System.Reflection.PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection) .GetProperty("IsReadOnly", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); isreadonly.SetValue(HttpContext.Current.Request.QueryString, false, null); HttpContext.Current.Request.QueryString.Clear(); } public void OnLogRequest(Object source, EventArgs e) { //custom logging logic can go here } } }
Please ; Any suggestion , this must works , but it doesn't , the url in the address bar still contains parameters , even after it has bean cleared