I have an ASPX page used to output an image from a database and write bytes. I have used this method in the past and it worked perfectly. The main rendering code is as follows:
GetBannerImage.aspx.cs
Response.Clear();
Response.ContentType = "image/png";
Response.AddHeader("Content-Length", Convert.ToString(banner.Image.Length));
Response.BinaryWrite(banner.Image);
Response.End();
On another page, Default.aspx, I spit some HTML into an ASP literal like this:
this.ltlImage.Text = "<img src='" + VirtualPathUtility.ToAbsolute("~/GetBannerImage.aspx?banner_id=" + banner.Id) + "' />";
I have a breakpoint in the Page_Load event of my GetBannerImage.aspx page.
When I look at the source page (in Firefox) of Default.aspx, I can click on the src attribute of the image, which links to my GetBannerImage.aspx page, hits the breakpoint and splashes the image. However, there is no image displayed on the screen on the Default.aspx page, and the breakpoint does not fall when loading Default.aspx.
In IE and Chrome, I do not have this problem - the image loads fine. I am sure that this is not a problem with my rendering code, and I am sure that the src tag is valid. I recently don't remember the Firefox update, but it seems to be a new issue. Anyone have any suggestions?
source
share