Image to load in larger popup

Discussion in 'ASP .Net Datagrid Control' started by csgraham74, May 22, 2005.

  1. csgraham74

    csgraham74 Guest

    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, May 22, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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, May 23, 2005
    #2
    1. Advertising

  3. csgraham74

    csgraham74 Guest

    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
     
    csgraham74, May 23, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Williams
    Replies:
    1
    Views:
    1,457
    Dylan Parry
    Jun 3, 2005
  2. =?Utf-8?B?Tm9ibGUgQmVsbA==?=

    Mouse-over image and zoom to larger size dynamically?

    =?Utf-8?B?Tm9ibGUgQmVsbA==?=, Jan 29, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,085
    John Timney \(MVP\)
    Jan 29, 2007
  3. John
    Replies:
    7
    Views:
    656
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    591
    Randy Webb
    Jun 19, 2004
  5. Clay
    Replies:
    1
    Views:
    163
    Elegie
    Sep 28, 2006
Loading...

Share This Page