Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   Image to load in larger popup (http://www.velocityreviews.com/forums/t762011-image-to-load-in-larger-popup.html)

csgraham74 05-22-2005 04:07 PM

Image to load in larger popup
 
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


Eliyahu Goldin 05-23-2005 08:57 AM

Re: Image to load in larger popup
 
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

"csgraham74" <csgraham74@hotmail.com> wrote in message
news:1116778056.579361.283430@g43g2000cwa.googlegr oups.com...
> 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
>




csgraham74 05-23-2005 10:20 PM

Re: Image to load in larger popup
 
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



All times are GMT. The time now is 07:19 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.