Re: displaying images on a website from binary
- From: "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 13:10:55 -0500
If I understand you correctly, you already know how to send the image to the
client.
It sounds like you want to put them into a page, whether it is an HTML page
or an ASP.Net (HTML) page, on the client.
Forgive me if I tell you anything you already know. An HTML document is
text. It contains no binary data. It can contain multiple image elements
which contain a reference to a URL where the image file is located.
Now, as you've already successfully streamed an image to a browser, I'll
assume you know about setting the Response.ContentType, and so on. The only
thing left to do is to take the page you have created to do this, and adapt
it to serve multiple images. This can most easily be done using a
QueryString. The image tag in the HTML document might look like the
following:
<img src="imagePage.aspx?id=1234">
The image page then reads the Request.QueryString to determine the image to
send. It then sends the image just as you have already done. In other words,
the ASPX page is treated as if it were the image.
You should be able to see how you can have multiple references to the same
ASPX page using different QueryStrings in the same HTML document.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"CLEAR-RCIC" <CLEARRCIC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:48AAC079-3683-47B0-A8D6-8A1F519DB846@xxxxxxxxxxxxxxxx
>I have several images i want to display in an ASP.Net application. The
> images are being passed to me in binary format from another application.
> Is
> there a good way to write them directly to an HMTL page without having to
> save them to the server and create a URL to the virtual directory?
>
> FYI: I currently am doing this with just single images. I do a
> Response.BinaryWrite(byte) to display the one image. The advantage is
> that I
> never have to worry about deleting the images at some later time.
> Unfortunatly, this method does not lend itself to multiple images.
.
- Prev by Date: obtain recordset of an object COM made in VB6 and soon fill dataset
- Next by Date: Re: httpwebrequests, cookies and sessionID
- Previous by thread: RE: displaying images on a website from binary
- Next by thread: httpwebrequests, cookies and sessionID
- Index(es):
Relevant Pages
|