473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Beginner question on Server.Transfer

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.
Nov 18 '05 #1
3 1104
Use a root-relative URL:

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

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

"Tom" <nf*@nospam.com> wrote in message
news:O0**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 18 '05 #2
You probably want to to Server.Transfer( "~/folderb/test.aspx" )

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

bill

"Tom" <nf*@nospam.com> wrote in message
news:O0****************@TK2MSFTNGP11.phx.gbl...
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.

Nov 18 '05 #3
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)

"Tom" <nf*@nospam.com> wrote in message
news:O0****************@TK2MSFTNGP11.phx.gbl...
| 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.
|
|
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Harsh Thakur | last post by:
Hi, I'd like to know the performance related differences between Response.Redirect and Server.Transfer. I'd like to redirect the user to a different page. I can either do a...
5
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user...
4
by: anonymous | last post by:
Hi Folks, I have a form with two Dropdown list boxes, which get loaded with data from Database. DropDownList1 gets data from Table1 and DropDownList2 gets data from Table2 Table1 has a...
9
by: Mark | last post by:
Hello I'm trying to use a Server.Transfer in a try-catch (I cannot put it outside the Try-Catch as it is nested deep within a component that is called in a try-catch loop) The problem is that the...
3
by: Chung Hang Shum | last post by:
I'm a beginner in ASP.Net. I'd wroten mange asp code before and now I need to transfer them from asp to asp.Net. In classical ASP you can write code like this: <% If strRequest = "ConfirmPasswd"...
5
by: Guadala Harry | last post by:
I've been reading up on Server.Transfer as well as doing some testing, and it appears to always raise the ThreadAbortException error. On one hand I've read a bunch of promotional-type material...
11
by: Alexander Bosch | last post by:
Hi, I'm having a problem similar to the one that's stated in this KB http://support.microsoft.com/default.aspx?scid=kb;en-us;839521 When I'm posting a page to itself with the bool value as true it...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
6
by: n# | last post by:
A Basic Question in ASP.NEt 1.1 In Page_Load Event I am doing a Server.Transfer. But it throws an error on the browser windows showing "Server Application Not Found" Pls help me
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.