<img> tag and resource files for scr-source?

O

Ole Hanson

I want to compile my images into a resource file and then use this for my
<img> tags in my table (<table><tr><img scr=(my resourcefile)</tr></table>;
instead of having a list of images on my server...

How can this be accomplished??

Thanks you!

/Ole
 
S

Steve C. Orr [MVP, MCSD]

You'll need a special page to output these images.
Every <img> tag will need to point to this page.
You page will read the image from the resource file and use
Response.OutputStream.Write method.

This example demonstrates how to do it, except it read from a database
instead of a resource file so it gets you at least half way there.
http://steve.orr.net/content/asp200307so_f.asp
 
O

Ole Hanson

I managed to make this very scenario happen (extracting images from
res-files) by inspiration from this article:
http://www.codeproject.com/aspnet/ressrvpage.asp

Basically you should implement the IHTTPHandler interface and implement the
method ProcessRequest. This will allow you to make a page that emits binary
data instead of html.

Works a charm.

Hope it helps!

/Ole
 

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