Beginner question on Server.Transfer

  • Thread starter Thread starter Tom
  • Start date Start date
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.
 
Use a root-relative URL:

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

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
You probably want to to Server.Transfer( "~/folderb/test.aspx" )

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

bill
 
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.
|
|
 
Back
Top