Tom Knowlton
asked on
Find out the virtual directory path
Is there a way for me to find out if my application is running inside of a virtual directory?
For example:
http://bookstore.slcc.edu/purchase/booksearch.aspx
/purchase
is a virtual directory.
When booksearch.aspx is loaded....in the Page Load can I find-out about "/purchase" virtual directory?
My problem is that when I redirect instead of going to:
http://bookstore.slcc.edu/purchase/somenewpage.aspx
I end up going to:
http://bookstore.slcc.edu/somenewpage.aspx
For example:
http://bookstore.slcc.edu/purchase/booksearch.aspx
/purchase
is a virtual directory.
When booksearch.aspx is loaded....in the Page Load can I find-out about "/purchase" virtual directory?
My problem is that when I redirect instead of going to:
http://bookstore.slcc.edu/purchase/somenewpage.aspx
I end up going to:
http://bookstore.slcc.edu/somenewpage.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Request.ApplicationPath seemed to solve the problem.
I had to add logic to check the length of the path. If there is no virtual directory, ApplicationPath is "/". If a virtual directory is in use, it will equal "/<virtual path alias>"
I had to add logic to check the length of the path. If there is no virtual directory, ApplicationPath is "/". If a virtual directory is in use, it will equal "/<virtual path alias>"
Dont use Response.Redirect("/MyPage