newbie: load image from db + Repeater

J

Jeff

hey

asp.net 2.0

With the help of a Repeater control on my webpage I want to dynamically
generate a list which contains both images and text field. This data are
stored in the aspnetdb.mdf database.

I know it's possible to have the imag tag to point to a .aspx file (<img
src="getImage.aspx" />)

This is the Page_Load event I have in my getImage.aspx file
protected void Page_Load(object sender, EventArgs e)
{
if (Profile.Picture != null)
{
Response.ContentType = Profile.PictureType;
Response.BinaryWrite(Profile.Picture);
Response.End();
}
}

The getImage.aspx file above is used another place in my project. My PROBLEM
is that I don't know how to adapt (make another version of getImage.aspx
which suit the repeater) this getImage.aspx file into the Repeater control.
More specific: in the Page_Load event of getImage.aspx you see that I'm
setting some properties of the Response object with some values of the
Profile object. But in the new getImage.aspx file (created specially for the
Repeater control) I must for each line in the Repeater control pass over the
correct ID to the Page_Load event so the getImage.aspx file knows what image
to load!

In other words how can I tell the Page_Load event what image to show. I
think about using a paramter. But my problem is that I don't know how to add
such a parameter. Maybe it could be passed in the EventArgs argument.. I'm
not sure....

Instead of sending the picture ID I could send over the bytes representing
the image. But even that, I (As Far As I Know) still have to send a paramter
to the Page_Load event

Any ideas how I should pass over such a parameter?

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top