Image to load in larger popup

C

csgraham74

Hi guys,

just wondering if anyone can help me. I have a datagrid control that
pulls images into a template column using the following code

<asp:TemplateColumn HeaderText="Image">
<ItemTemplate>
<asp:image ImageUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,
"product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>
</ItemTemplate>
</asp:TemplateColumn>

FormatURL - sets the path of the image.
I need to create some code that allows me to open a popup window when i
click on the image and to display a larger version of the image.

Im not sure how to go about this ??? any help or ideas appreciated.

thanks in advance

C
 
E

Eliyahu Goldin

Add a client side onclick event for the image (c# syntax):

Image1.Attributes["onclick"]="showModalDialog('zoom.aspx?url='+this.src,'','
');

zoom.aspx is a web form you need to make to get the enlarged image by
supplied url parameter.

Eliyahu
 
C

csgraham74

thanks for your help but are you sure this will work when my image is
in the datagrid ?????

i thought this would only work if my image was on the form.

thanks again
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top