popup window from datagrid using asp.net

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

  1. csgraham74

    csgraham74 Guest

    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(Cont­ainer.DataItem,
    "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>


    </ItemTemplate>
    </asp:TemplateColumn>


    FormatURL - sets the path of the image.

    What i want to do is to be able to click on my image in the datagrid
    and for a small window to popup with the image, description and name of
    my item in the window.

    Im not too sure how to do this -
    1. Is it possible with my current setup ?
    2. What do i need to add to my image template column ???


    Any asp.net examples greatly appreciated.
     
    csgraham74, May 31, 2005
    #1
    1. Advertising

  2. csgraham74

    Scott M. Guest

    Since popup windows are only generated by the client, you will need to add
    client-side code to the server-side control to make this happen.
    Specifically:


    "csgraham74" <> wrote in message
    news:...

    I have a datagrid control that
    pulls images into a template column using the following code

    <A
    HREF="JavaScript:popupFunction(<%#FormatURL(DataBinder.Eval(Cont­ainer.DataItem,
    "product_image")) %>)">
    <asp:image ImageUrl='<%#
    FormatURL(DataBinder.Eval(Cont­ainer.DataItem,
    "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>
    </A>

    and then in the HEAD section of the page:

    <SCRIPT LANGUAGE="JavaScript">

    function popupFunction(prodImage)
    {
    var newWin = window.open()
    newWin.document.write("<IMG SRC='" + prodImage + "'>")
    }

    </SCRIPT>





    <asp:TemplateColumn HeaderText="Image">
    <ItemTemplate>

    <asp:image ImageUrl='<%#
    FormatURL(DataBinder.Eval(Cont­ainer.DataItem,
    "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>


    </ItemTemplate>
    </asp:TemplateColumn>


    FormatURL - sets the path of the image.

    What i want to do is to be able to click on my image in the datagrid
    and for a small window to popup with the image, description and name of
    my item in the window.

    Im not too sure how to do this -
    1. Is it possible with my current setup ?
    2. What do i need to add to my image template column ???


    Any asp.net examples greatly appreciated.
     
    Scott M., Jun 1, 2005
    #2
    1. Advertising

  3. All you need is to set the ToolTip property of the <asp:Image..>

    Eliyahu

    "csgraham74" <> wrote in message
    news:...

    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(Cont­ainer.DataItem,
    "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>


    </ItemTemplate>
    </asp:TemplateColumn>


    FormatURL - sets the path of the image.

    What i want to do is to be able to click on my image in the datagrid
    and for a small window to popup with the image, description and name of
    my item in the window.

    Im not too sure how to do this -
    1. Is it possible with my current setup ?
    2. What do i need to add to my image template column ???


    Any asp.net examples greatly appreciated.
     
    Eliyahu Goldin, Jun 1, 2005
    #3
  4. csgraham74

    Scott M. Guest

    That's not what the OP is asking about.


    "Eliyahu Goldin" <> wrote in message
    news:%...
    > All you need is to set the ToolTip property of the <asp:Image..>
    >
    > Eliyahu
    >
    > "csgraham74" <> wrote in message
    > news:...
    >
    > 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(Cont­ainer.DataItem,
    > "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>
    >
    >
    > </ItemTemplate>
    > </asp:TemplateColumn>
    >
    >
    > FormatURL - sets the path of the image.
    >
    > What i want to do is to be able to click on my image in the datagrid
    > and for a small window to popup with the image, description and name of
    > my item in the window.
    >
    > Im not too sure how to do this -
    > 1. Is it possible with my current setup ?
    > 2. What do i need to add to my image template column ???
    >
    >
    > Any asp.net examples greatly appreciated.
    >
    >
     
    Scott M., Jun 2, 2005
    #4
  5. Let the OP evaluate the value of the responses himself.

    Eliyahu

    "Scott M." <> wrote in message
    news:%...
    > That's not what the OP is asking about.
    >
    >
    > "Eliyahu Goldin" <> wrote in message
    > news:%...
    > > All you need is to set the ToolTip property of the <asp:Image..>
    > >
    > > Eliyahu
    > >
    > > "csgraham74" <> wrote in message
    > > news:...
    > >
    > > 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(Cont­ainer.DataItem,
    > > "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>
    > >
    > >
    > > </ItemTemplate>
    > > </asp:TemplateColumn>
    > >
    > >
    > > FormatURL - sets the path of the image.
    > >
    > > What i want to do is to be able to click on my image in the datagrid
    > > and for a small window to popup with the image, description and name of
    > > my item in the window.
    > >
    > > Im not too sure how to do this -
    > > 1. Is it possible with my current setup ?
    > > 2. What do i need to add to my image template column ???
    > >
    > >
    > > Any asp.net examples greatly appreciated.
    > >
    > >

    >
    >
     
    Eliyahu Goldin, Jun 2, 2005
    #5
  6. csgraham74

    Scott M. Guest

    How about you simply read the OP in the first place?

    "What i want to do is to be able to click on my image in the datagrid
    and for a small window to popup with the image, description and name of
    my item in the window."

    Now, tell me how a ToolTip is going to contain an image?



    "Eliyahu Goldin" <> wrote in message
    news:e%...
    > Let the OP evaluate the value of the responses himself.
    >
    > Eliyahu
    >
    > "Scott M." <> wrote in message
    > news:%...
    >> That's not what the OP is asking about.
    >>
    >>
    >> "Eliyahu Goldin" <> wrote in message
    >> news:%...
    >> > All you need is to set the ToolTip property of the <asp:Image..>
    >> >
    >> > Eliyahu
    >> >
    >> > "csgraham74" <> wrote in message
    >> > news:...
    >> >
    >> > 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(Cont­ainer.DataItem,
    >> > "product_image")) %>' Width="90" Height="70" Runat=server ID="Image1"/>
    >> >
    >> >
    >> > </ItemTemplate>
    >> > </asp:TemplateColumn>
    >> >
    >> >
    >> > FormatURL - sets the path of the image.
    >> >
    >> > What i want to do is to be able to click on my image in the datagrid
    >> > and for a small window to popup with the image, description and name of
    >> > my item in the window.
    >> >
    >> > Im not too sure how to do this -
    >> > 1. Is it possible with my current setup ?
    >> > 2. What do i need to add to my image template column ???
    >> >
    >> >
    >> > Any asp.net examples greatly appreciated.
    >> >
    >> >

    >>
    >>

    >
    >
     
    Scott M., Jun 2, 2005
    #6
    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. =?Utf-8?B?Sko=?=
    Replies:
    1
    Views:
    2,242
    =?Utf-8?B?dmluYXk=?=
    Oct 12, 2004
  2. =?Utf-8?B?Sm9obiBXYWxrZXI=?=

    Popup Window Popup Timing

    =?Utf-8?B?Sm9obiBXYWxrZXI=?=, Nov 4, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    882
    =?Utf-8?B?Sm9obiBXYWxrZXI=?=
    Nov 4, 2005
  3. dapkniht
    Replies:
    1
    Views:
    1,384
    Eliyahu Goldin
    Mar 8, 2006
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    593
    Randy Webb
    Jun 19, 2004
  5. Raffi
    Replies:
    4
    Views:
    262
    Dr John Stockton
    Aug 12, 2004
Loading...

Share This Page