J
Joe Reiss
Hi All,
Using vs2005, C#, SQL Server 2005/Shared Environment.
This is my second Post since I got absolutely no responses the first time.
I really need to solve this one.
I'm attempting to populate an image control from a jpeg stored in a image
field in sql server. Tried using both the HTML image (runat = "server") and
ASP image controls - can't get
either to work.
I'm basically using the technique outlined in the ASP.NET 2.0 Cookbook
(OReilly) and many other places and articles.
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 that gets the jpeg data to render 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 the Page_Load event is firing.
The
session variable does not get populated, so, it seems that Page_Load event
doesn't event fire.
Can someone help me out?
Thanks,
Joe
Using vs2005, C#, SQL Server 2005/Shared Environment.
This is my second Post since I got absolutely no responses the first time.
I really need to solve this one.
I'm attempting to populate an image control from a jpeg stored in a image
field in sql server. Tried using both the HTML image (runat = "server") and
ASP image controls - can't get
either to work.
I'm basically using the technique outlined in the ASP.NET 2.0 Cookbook
(OReilly) and many other places and articles.
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 that gets the jpeg data to render 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 the Page_Load event is firing.
The
session variable does not get populated, so, it seems that Page_Load event
doesn't event fire.
Can someone help me out?
Thanks,
Joe