Beginner question on Server.Transfer

T

Tom

Is there a way to reference the website root in a transfer?

For example, Server.Transfer("../folderb/test.aspx") works if the page being
redirected is in, say, foldera but not if it is in the root. I want to do
this in a generic way so if the application is moved to another server it
will still work.
 
K

Kevin Spencer

Use a root-relative URL:

Server.Transfer("/folderb/test.aspx")

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
W

William F. Robertson, Jr.

You probably want to to Server.Transfer( "~/folderb/test.aspx" )

The ~ means to go up to the root of the application.

bill
 
B

bruce barker

Server Transfer can only transfer to pages in the current vdir (web
application), because it just creates an instance of the page, and calls its
methods.

-- bruce (sqlwork.com)

| Is there a way to reference the website root in a transfer?
|
| For example, Server.Transfer("../folderb/test.aspx") works if the page
being
| redirected is in, say, foldera but not if it is in the root. I want to do
| this in a generic way so if the application is moved to another server it
| will still work.
|
|
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top