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

Disabling image path rebasing

Hi,

I'm wondering if there's a way to prevent ASP.Net from rebasing the
URLs/Paths in my Images.

My website is using a reasonably complex system to perform skinning
(custom code combined with out of the box ASP themes). The problem is
that whenever I add an image (either Image or HtmlImage), ASP is
overwriting my URL with it's version. I need the URL to be fixed to
http://mysite/images/xyz.jpg.

I've managed to get it going by using a literal control, however I'd
rather use server side controls because of their other benefits.

Thanks very much in advance,
Damien
Aug 25 '08 #1
3 997
Could you show an example how it transforms your constant URL ?
there are several methods like ResloveURL or ResolveClientUrl have u
tried these kind of methods and see if something cold be helpful?
Aug 25 '08 #2
forgot to leave this link, could be helpful: http://www.west-wind.com/weblog/posts/269.aspx
Aug 25 '08 #3
Hi,

Thanks for that.

The issue was to do with the 'rebasing' of images when using Master
pages (Lookup "URL Rebasing In Master Pages" in http://www.odetocode.com/Articles/419.aspx).

Your article helped alot though in that I used it to just create a
'fully formed' URL. It appears that rebasing only occurs when the URL
passed to a control is 'relative'.

If you're interested, the code I ended up with was

_images.ToList().ForEach(x =>
{
// Need to pass the fully formed URL to prevent
rebasing.
string URL =
Request.Url.AbsoluteUri.Replace(Request.FilePath, "/tempfiles/") +
x.ThumbanailFileName(false);
Image i = new Image() { ImageUrl = URL };
this.ph1.Controls.Add(i);
});
Thanks very much for your help.

Damien
Aug 25 '08 #4

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

Similar topics

5
by: Kevin Vogler | last post by:
I have a subdirectory with it's own images folder. All the image paths in the pages in the sub directory are "image/image.jpg" When I Response.Redirect to a page in the subdirectory the images...
9
by: TJS | last post by:
when using a relative image path const imgDir = "_images/divisions/" the relative path is converted to a physical path in an img tag as <img src="c:\app\_images\divisions\mypicture.gif"> ...
1
by: William Starr Moake | last post by:
This is for a browser-based WYSIWYG editor to convert image file paths from absolute to relative when the page under construction is saved. From inside the save function I get error message:...
2
by: Jester | last post by:
I'm fairly new to asp.net. What is the syntax for the string to pull and image path from a DB and display that image based on the given path? I am trying to stay away from actually storing images...
2
by: Skiran | last post by:
I have stored image address in the database (Ms-Access). I wanted to pass run time this image path to crystal report to display the image in report. I am using VB6, Ms-Access and Crystal report 8....
3
by: Maverick | last post by:
Hi, I have to give a browse button and you will be able to browse and pick the image path instead of typing it out. One more requirement will be the image will be residing on a shared machine in...
1
by: peerraghu | last post by:
hi I am creating travels project, I have to sstore image path in the sqlserver and i want to retrive image in the datagridview.. please sought out my problem.. athank you raghu
3
by: sejal17 | last post by:
Hello I have got image path in javascript from php code. That is:http://localhost/fotolia/photos/9.jpg I want to take only photos/9.jpg from that full path.How can i do that?Please...
2
by: hiranmaie | last post by:
I am having the problem with the image path. I am using a master page and the reference to the image in web content page which is not working properly. It shows Done, with errors on page error. If I...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.