How to refer to Root on Transfer

P

paul reed

Hi ,

I have a few folders within my root directory on my web server where
different app components live. One folder, "Reports", is where all the ASPX
pages live that have reports embedded in them (Crystal). However, we also
have very fine-grained application security that we implement. When a
security violation is encountered, we send them to a common security
violation page. My problem is that I have a common component that does the
checking and the actually transferring to the security violation page. When
I do this:

Server.Transfer("SecurityViolation.aspx")

It works if that page calling the security component is at the root level.
However, if do the same thing from an ASPX page within the "Reports" folder,
it can't find the Security page. Reason being it is a page nested within
Reports and SecurityViolation.ASPX lives at the Root level.

My question is, how does one specify to always look in the Root directory
with the Transfer method. I don't want to have to do something like:

Server.Transfer("..\SecurityViolation.aspx") if I am in the Reports folder
and without the "..\" when at the root.

Hardcoding the path like this works for those ASPX pages in the Reports
folder...but not what I want to do.

Thanks...Paul
 
J

Jacob Yang [MSFT]

Hi Paul,

The Server.Transfer terminates execution of the current page and begins
execution of a new page using the specified URL path to the page.

If the new page is in the current directory, we can use the page name
directly.

Server.Transfer("Simple.aspx")

If the new page is not in the current directory, we need to specify the
opposite path or the absolute path. As I understand, what you want is using
the absolute directory. It works whether the new page is in the current
directory or not.

Server.Transfer("/App1/Simple.aspx")

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top