Link to home
Create AccountLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

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

ASKER CERTIFIED SOLUTION
Avatar of Praveen Venu
Praveen Venu
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
redirect like Response.Redrect("MyPage.aspx")

Dont use Response.Redirect("/MyPage.aspx")
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Tom Knowlton

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>"