T
the4man
Hi all!
I have an app that show images that are stored in SQL Server. To show
the images on screen, until now (with the "old" ASP), I use the
following code:
<img src="showimage.asp?id=20" />
And in "showimage.asp" (more or less, I write from memory)
Response.Contentype ="binary"
.....
....get the image from DB
.....
Response.BinaryWrite imagecontent.
Now, with ASP.NET I have the posibility of use a httphandler to do
this. For example, I could use <img src="40.gfx" />, with a httphandler
for the .gfx extension that generate the image (as in the old
showimage.asp page).
I think that the second method is more elegant. Even mor efficient (it
consume less resources because the httphandler class is lighter than
page class). But, besides that, is there any other reason to prefer the
second method instead of the first one?
Thanks in advance!
I have an app that show images that are stored in SQL Server. To show
the images on screen, until now (with the "old" ASP), I use the
following code:
<img src="showimage.asp?id=20" />
And in "showimage.asp" (more or less, I write from memory)
Response.Contentype ="binary"
.....
....get the image from DB
.....
Response.BinaryWrite imagecontent.
Now, with ASP.NET I have the posibility of use a httphandler to do
this. For example, I could use <img src="40.gfx" />, with a httphandler
for the .gfx extension that generate the image (as in the old
showimage.asp page).
I think that the second method is more elegant. Even mor efficient (it
consume less resources because the httphandler class is lighter than
page class). But, besides that, is there any other reason to prefer the
second method instead of the first one?
Thanks in advance!