Insert inline image -> without another aspx page in src

J

jenp

Hello

I've got a rather tricky problem here - i'm looking to insert a graph
into a web page - which is represented as a jpeg image.

Due to the restrictions of the framework i'm developing against, the
data for the graph is only stored in the HTTPContext's Items
collection, so the page that displays the graph is the only one with
the data.

This means I can't simply reference another aspx page in the src tag of
the image

<img src="graphImage.aspx"/> <!-- No good -->

I've also tried to call a method to do a Reponse.BinaryWrite of the
image's binary data - but this doesn't work either, as the Response
object becomes confused with multiple content types.

<img src='<%GetGraphData();%>'/> <!-- Spits out random ASCII chars -->

Is there any way that I can spoof a complete HTTPResponse from within a
method in the code behind page, so the browser thinks it is pointing to
a separate page in the src tag? Something along the lines of creating a
new Response object I assume, although any pointers would be very
useful...

Many thanks

Phil
 
G

Guest

This is possible but IE doesnt support inline images. The best this to do
would be to take it from the context yourself and save it to a folder on the
web server. Then use that as the image source. You could cache where you
saved it and remove it later, or remove it on Session_End.

Ciaran O'Donnell
 
P

Pancho

i think you can solve your problem using httphandlers....

this solution requires a customized configuration in the IIS...but it
solve the problem of getting an image that has no path in the web
server.

Regards.

Francisco.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top