Rouchie
New member
I have a httpModule that's supposed to check for a session value before sending the page contents to the user. If the session value doesn't exist, it redirects the user to a login page.
The problem is that this module is somehow preventing WebResource.axd from working. When the module is enabled, the browser fails to read the javascript within the webresource.axd and throws javascript errors, especially on pages where asp:validators are present.
Can anyone see what might be causing this based on the module's code...?
The problem is that this module is somehow preventing WebResource.axd from working. When the module is enabled, the browser fails to read the javascript within the webresource.axd and throws javascript errors, especially on pages where asp:validators are present.
Can anyone see what might be causing this based on the module's code...?
VB.NET:
Public Class checkSession
Implements IHttpModule
Public Sub New()
End Sub
Public Sub Init(ByVal ctx As HttpApplication) Implements System.Web.IHttpModule.Init
AddHandler ctx.PostAcquireRequestState, AddressOf context_PostAcquireRequestState
End Sub
Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
End Sub
Private Sub context_PostAcquireRequestState(ByVal sender As Object, ByVal e As EventArgs)
Dim ctx As HttpContext = HttpContext.Current
Dim session As HttpSessionState = ctx.Session
If Not ctx.Request.RawUrl.Contains("login.aspx") Then
If session("ID") Is Nothing Then
ctx.Response.Redirect("login.aspx", True)
End If
End If
End Sub
End Class