ASP.NET: CSS disappear after redirect from Global.asax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daonho
    New Member
    • Apr 2008
    • 18

    ASP.NET: CSS disappear after redirect from Global.asax

    Protected Sub Application_Beg inRequest(ByVal sender As Object, ByVal e As System.EventArg s)
    Dim strPath As String = HttpContext.Cur rent.Request.Pa th()

    Dim cookie As HttpCookie = HttpContext.Cur rent.Request.Co okies("MyCookie Name")

    ' Handle if cookie not exist
    If cookie Is Nothing Then
    ' Redirect to login page if cookie doesn't exist
    If (strPath.ToLowe r.Contains("log in.aspx") = False) Then
    HttpContext.Cur rent.Response.R edirect("login. aspx")
    End If
    End If

    End Sub

    ----
    I have a simple website with a default.aspx page and login.aspx. I attempt to create a global.asax file which check to if cookie exist for current user at application begin request. If cookie doesn't exist, then redirect to the login.aspx page. It seems to work and redirect to the login.aspx page as intended except after being redirected from global.asax, all cascade style of the login.aspx disappears. All code needed for the css are there, I just can't understand why css it doesn't apply to the page. Anyone encounter similar issue? It there any setting require in order to use global.asax?
Working...