473,396 Members | 1,921 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,396 software developers and data experts.

Server.Transfer Virtual Directory Problems

Has anyone come across the problem that I am experiencing?

I have a master page using four or five Hyperlink controls, each with
an ImageUrl. The ImageUrl is specified using a virtual directory path,
such as ImageUrl = "~/Images/Main.gif".

I have a child page in a sub directory, images all appear to be
correct. However, if I use a Server.Transfer to transfer to a different
child page in a different sub directory or at the root level, the
ImageUrl path does not update correctly. The hyperlink ImageUrl points
to an invalid directory. However the hyperlink NavigateUrl is always
correct, even though this also makes use of a virtual directory path.

To get the graphics to work again I need to physically refresh the page
with the F5 key.

Sound like an ASP.NET bug?

If I use a Response.Redirect rather than a Server.Transfer then it all
works as expected.

James

Apr 2 '06 #1
1 3521
I don't think it's a bug - the problem you're having is easily
explained if you look at the difference between Server.Transfer (use
current request state on a different page) and Response.Redirect(send a
new request to somewhere else)

Because the transferred request has the original URL, it's mapping your
directories wrongly.

http://www.developer.com/net/asp/article.php/3299641

Apr 2 '06 #2

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

Similar topics

0
by: Rick Strahl [MVP] | last post by:
Hi all, Has anybody run into this scenario: From within a page I use a Server.Transfer() to run another ASPX page. The other ASPX page however is not in the current directory but a sub of the...
2
by: Mr Wizard | last post by:
I am going through the front controller http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer...
1
by: Ryan | last post by:
Hello, I am having a really strange issue, I have folder containing an ASP.NET application. (The folder's name is Web) The root directory of the whole site I have an Index.aspx page that...
1
by: Net Developer | last post by:
I moved some stuff around on our web server and am suddenly getting the following error message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: mbosco51 | last post by:
Hi. I have an external facing website that has both a customer login and an admin login. I want to prevent external access to the admin login for security reasons. On the same webserver I...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.