Problem with <img> and an Http Handler that returns an image

A

Alfonso Moreno

Hello,

- I have defined in web.config the http handler like this:

<handlers>
<add verb="*" path="ImageThumbnailer.ashx"
type="Thumbnailer.Handler.Thumbnailer, Thumbnailer.Handler"/>
....

- My http handler looks like:
namespace Thumbnailer.Handler
{
public class Thumbnailer : BaseHttpHandler
.....


- I create dynamically with javascript, an image like this and the .src
property is defined also:

var img = document.createElement("img");
img.src = "ashx/ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";
or
img.src = "ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";

but the property is stored on the database like :

http://localhost:49573/SubdirCurren...nailer.ashx?img=../Images/Image01.jpg&size=72

That is to say, the full path is prepended to the path of the current page.

Does anyone have any clue as what it is happening ?

Regards
Alfonso Moreno
 
A

Alfonso Moreno

but the property is stored on the database like :


Sorry, this must be read...

but the property img.src is stored as this:

http://localhost:49573/SubdirCurren...nailer.ashx?img=../Images/Image01.jpg&size=72 That is to say, the full path of the current page is prepended.This happens in IE4+.RegardsAlfonso Moreno"Alfonso Moreno" <[email protected]> wrote in messageHello,>> - I have defined in web.config the http handler like this:>> <handlers>> <add verb="*" path="ImageThumbnailer.ashx"type="Thumbnailer.Handler.Thumbnailer, Thumbnailer.Handler"/>> ...>> - My http handler looks like:> namespace Thumbnailer.Handler> {> public class Thumbnailer : BaseHttpHandler> ....>>> - I create dynamically with javascript, an image like this and the .srcproperty is defined also:>> var img = document.createElement("img");> img.src = "ashx/ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";> or> img.src = "ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";>> but the property is stored on the database like :>>http://localhost:49573/SubdirCurren...nailer.ashx?img=../Images/Image01.jpg&size=72>> That is to say, the full path is prepended to the path of the currentpage.>> Does anyone have any clue as what it is happening ?>> Regards> Alfonso Moreno>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top