This code snippet is checking the URL of the current page and counting the number of slashes in the URL. If there are 3 slashes, the user is redirected to the LOGIN.aspx page, otherwise they are redirected to a parent folder and then the LOGIN.aspx page after removing their username session variable.
1 of 1
Download to read offline
More Related Content
Code for url
1. Dim str As String
Dim count As Integer
'// to find out the url and then counting the no of /
str = Request.ServerVariables("url")
count = str.Split("/").Length
Session.Remove("UnameOnAllPage")
If count = 3 Then
Response.Redirect("LOGIN.aspx")
Else
Response.Redirect("..LOGIN.aspx")
End If