|
-
Oct 10th, 2005, 01:53 AM
#1
Thread Starter
Hyperactive Member
Determine path of page **Resolved**
hi all,
I have several pages in an asp.net application that requires a user to login through a login.aspx webform before being able to access the resources in the application. now my problem is that in each and every aspx page, I need to check if the user has already logged into the system, failing which i need to redirect him to the login.aspx webform. to do so i have implemented a function in a module to check the login status and perform the page redirection. the problem is that the login page is not always the same relative path in respect to the other pages of the application, since most of the pages are found in different sub-folders. So what i need is to be able to obtain the path of the current page that is being run. something like the path of the page relative to the root folder etc. is this at all possible?
thanx all
Last edited by vbud; Oct 12th, 2005 at 12:56 AM.
Reason: Resolved
-
Oct 10th, 2005, 05:31 AM
#2
Fanatic Member
Re: Determine path of page
Yes, I believe you're looking for
VB Code:
Request.ServerVariables("Script_Name")
Here is a full list of the server variables 4guysfromrolla
Cheers Al
-
Oct 12th, 2005, 12:54 AM
#3
Thread Starter
Hyperactive Member
Re: Determine path of page
Well in fact what i needed was HttpContext.Current.Request.Path.ToString, that gives you the current path of the page that was requested in fact. thanx anyways
-
Oct 16th, 2005, 09:35 AM
#4
Fanatic Member
Re: Determine path of page **Resolved**
VBud,
I've just tested your response and they return exactly the same thing. Anyway glad you're sorted
HttpContext.Current.Request.Path.ToString
HttpContext.Current.Request.ServerVariables("Script_Name")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|