Last post Sep 10, 2008 07:51 AM by Thomas Sun – MSFT
Sep 06, 2008 08:07 AM|sabrick|LINK
dbRead = dbComm.ExecuteReader()
the issue is that it only writes the first row and then gives up! It doesn't crash, it doesn't give an error, it simply display the first image and does not display anything else.
also... I can't right click and save the image when it is being displayed, the error that pops up when I attempt to right click the image is: "The file type being saved or retrieved has been blocked"
Sep 06, 2008 11:57 AM|joteke|LINK
images are resources fetched by the browser one at a time per request. e.g getting one image is one request, you can't mix markup and other resources like images to same response with the one sending the IMG markup itself to the browser. So if you have <IMG
src="image.jpg"> in browser that gets the image for you with separate request to image.jpg
So if you want your page to show multiple images like that, you need to have multiple IMG tags - it's one and the same how you generate them, say with a repater or manually - (where the URl points to is another thing, for example it can be a HTTP handler
specialized in serving images) Ok. this is from the page's standpoint which shows the images. Note that from server-side point of view, you can basically servee only one image to a response. and that's why you see only the first image (in addition to that
you'd need to have a IMG tag pointing to it so that image can be mixed with another content).
Sep 07, 2008 12:06 AM|sabrick|LINK
Okay, so reading that I have changed my style up and I'm doing something else
bitmap.Save(path) ' save the image
Response.Write("<img src=""image/" & &
"<br />") 'write the image as a Html object
That's all fine and good, but I'd like to make one little change:
Instead of the <img> pointing to a file that exist on my hard drive, I'd like it to point to the memory stream or the bitmap so that I don't have to waste space and time saving each of the images to a hard drive. Here is an example:
Response.Write("<img src="" " & Memorystrem &
Response.Write("<img src="" " & bitmap &
obviously neither of those two will work, I'm just trying to convey what I'm attempting to do, any ideas?
Sep 10, 2008 07:51 AM|Thomas Sun – MSFT|LINK
If we don't want to save them in the file system, we can write it to client directly.
In your case, we can use GridView to display images and use another page to write images separately.
For instance, we use "SELECT row, image FROM ( select row_number() over (order by Timestamp desc) as row, image from blive) as BliveWRow
" to bind GridView and add TemplateItem to it:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False">
<asp:Image ID="HyperLink1" NavigateUrl='<%# "DisplayImage.aspx?id=" +Eval("row")%>' runat="server" />
In the DisplayImage page, we can get the row and query the image to write in page load event:
I look forward to hearing from you.