PC Review


Reply
Thread Tools Rate Thread

Disabling image path rebasing

 
 
DamienS
Guest
Posts: n/a
 
      25th Aug 2008
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
 
Reply With Quote
 
 
 
 
AleXmanFree
Guest
Posts: n/a
 
      25th Aug 2008
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?
 
Reply With Quote
 
AleXmanFree
Guest
Posts: n/a
 
      25th Aug 2008
forgot to leave this link, could be helpful: http://www.west-wind.com/weblog/posts/269.aspx
 
Reply With Quote
 
DamienS
Guest
Posts: n/a
 
      26th Aug 2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling save an image =?Utf-8?B?bW5hcG9saXRhbm8=?= Microsoft Frontpage 4 12th May 2007 05:53 AM
Display an image whos image path is stored in a SQL DB =?Utf-8?B?SmVzdGVy?= Microsoft C# .NET 2 12th Sep 2005 08:48 PM
image path and and partial image name =?Utf-8?B?SmFtZXM=?= Microsoft Access VBA Modules 3 17th Oct 2004 02:09 PM
Drive Image 7.0 and disabling FP John Microsoft Frontpage 2 23rd Jan 2004 04:55 PM
Re: Displaying a image (image path is in a field) for each record in a report. Bruce M. Thompson Microsoft Access Reports 0 26th Jul 2003 05:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.