J
Joe Reiss
Hi All,
Using vs2005, C#, SQL Server 2005/Shared Environment.
I'm attempting to populate an image control from a jpeg stored in a image
field in sql server. Tried using both HTML image and ASP image - can't get
either to work.
I'm basically using the technique outlined in the ASP.NET 2.0 Cookbook
(OReilly).
So, in my page that has the image controls the code in the view photo button
event is
img.Src = "LoadPhoto.aspx?ID=7";
img.visible = true;
The LoadPhoto.aspx has no HTML just the 'Page, AutoEventWireup,
CodeFile,Inherits' as specified for this technique. The codebehind for
LoadPhoto.aspx.cs has the Page_Load event where it gets the jpeg data and
calls Response.ContentType = "image/jpeg" then Response.BinaryWrite( calls
function that returns byte[] array from database).
I cannot get this to work. Also, I put in some code into LoadPhoto.aspx.cs
to populate a session varible just to see if this Page-Load is firing. The
session variable does not get populated, so, it seems that all this code
doesn't even execute.
Can someone help me out?
Thanks,
Joe
Using vs2005, C#, SQL Server 2005/Shared Environment.
I'm attempting to populate an image control from a jpeg stored in a image
field in sql server. Tried using both HTML image and ASP image - can't get
either to work.
I'm basically using the technique outlined in the ASP.NET 2.0 Cookbook
(OReilly).
So, in my page that has the image controls the code in the view photo button
event is
img.Src = "LoadPhoto.aspx?ID=7";
img.visible = true;
The LoadPhoto.aspx has no HTML just the 'Page, AutoEventWireup,
CodeFile,Inherits' as specified for this technique. The codebehind for
LoadPhoto.aspx.cs has the Page_Load event where it gets the jpeg data and
calls Response.ContentType = "image/jpeg" then Response.BinaryWrite( calls
function that returns byte[] array from database).
I cannot get this to work. Also, I put in some code into LoadPhoto.aspx.cs
to populate a session varible just to see if this Page-Load is firing. The
session variable does not get populated, so, it seems that all this code
doesn't even execute.
Can someone help me out?
Thanks,
Joe