D
damiensawyer
Hi all,
I hope that this question isn't too simple...
I am storing all of my webforms in a /forms directory (with the
exception of Default.aspx). I have created the following code in
Global.asax which is supposed to forward people to the login page if
they make a request (for any page) without an active session.
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
If InStr(Request.Path.ToLower, "login.aspx") = 0 Then
Response.Redirect("forms/login.aspx")
End If
End Sub
The problem is, It appears to be adding the url to the end of the
current path. So, if they were in a form in the forms directory which
has 'expired', the redirection is attempted againts
http://localhost/myapp/forms/forms/login.aspx
I've tried "./../forms/logix.aspx" however to no avail... because files
are not 'always' called from the forms directory (eg, default.aspx)
Can someone please point out to me what I'm doing wrong?
Thanks in advance,
Damien Sawyer
I hope that this question isn't too simple...
I am storing all of my webforms in a /forms directory (with the
exception of Default.aspx). I have created the following code in
Global.asax which is supposed to forward people to the login page if
they make a request (for any page) without an active session.
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
If InStr(Request.Path.ToLower, "login.aspx") = 0 Then
Response.Redirect("forms/login.aspx")
End If
End Sub
The problem is, It appears to be adding the url to the end of the
current path. So, if they were in a form in the forms directory which
has 'expired', the redirection is attempted againts
http://localhost/myapp/forms/forms/login.aspx
I've tried "./../forms/logix.aspx" however to no avail... because files
are not 'always' called from the forms directory (eg, default.aspx)
Can someone please point out to me what I'm doing wrong?
Thanks in advance,
Damien Sawyer