Re: Simple Question regarding relative path references



Have you tried:

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

However you should check out:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaspnetauthentication.asp
and
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthecookieauthenticationprovider.asp
as Form authentication is already provided for you.

.



Relevant Pages

  • Re: Global.asax not firing
    ... Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ... ' Fires when the application is started ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Global.asax not firing
    ... Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ... ' Fires when the application is started ...
    (microsoft.public.dotnet.framework.aspnet)
  • Wrapping FileSystemWatcher to prevent crossthread ops
    ... Public Shadows Event Changed(ByVal sender As Object, ... Private Delegate Sub DelegatorFSE(ByVal sender As Object, ... Private Sub watch_Changed(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Global.asax not firing
    ... Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ... ' Fires when the application is started ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Global.asax not firing
    ... Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ... ' Fires when the application is started ...
    (microsoft.public.dotnet.framework.aspnet)