Hi Mike Volodarsky,
Thanks a lot for explaining it very clearly and also for the link.
Here is what I have to do, I have a page "page1.aspx", which has a link that takes me to "page2.aspx".This page2.aspx is a third party application where I cannot insert or add anything in the web.config file of this page.
So we wrote a HttpModule dll to check the urlrefferer of the page2.aspx, if it exist it will be displayed or else it will be redirected page2.aspx
Here is my HttpModule
Namespace SecurityModules
Public Class CustomURLModule
Implements IHttpModule
Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
End Sub
Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
AddHandler context.BeginRequest, AddressOf onBeginRequest
AddHandler context.EndRequest, AddressOf onEndRequest
End Sub
Public Sub onBeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim app As HttpApplication
app = CType(sender, HttpApplication)
If System.Web.HttpContext.Current.Request.Url.AbsolutePath = "http://localhost/Mypage/page2.aspx" Then
If System.Web.HttpContext.Current.Request.UrlReferrer Is Nothing Then
System.Web.HttpContext.Current.Response.Redirect("http://localhost/TestPage/page1.aspx")
End If
End Sub.
So I tried doing according to the instructions in blog, Just by adding the dll in the "bin" folder of the application and mapping the ASPNET_ISAPI.DLL as wildcard application.It is not working. Am I missing something?
Suren