HyperLink with an image

Discussion in 'ASP .Net Datagrid Control' started by Samuel Shulman, Dec 6, 2006.

  1. Below is the code that I use
    <asp:TemplateField>

    <ControlStyle Height="75px" Width="75px" />

    <ItemStyle Height="75px" Width="75px" />

    <ItemTemplate>

    <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
    ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%# Eval("ProductURL")
    %>' />

    </ItemTemplate>

    </asp:TemplateField>


    The problem is that the image appears in it's original size and I want it to
    be 75px / 75px only

    Thank you,
    Samuel
    Samuel Shulman, Dec 6, 2006
    #1
    1. Advertising

  2. Samuel Shulman

    Riki Guest

    Samuel Shulman wrote:
    > Below is the code that I use
    > <asp:TemplateField>
    >
    > <ControlStyle Height="75px" Width="75px" />
    >
    > <ItemStyle Height="75px" Width="75px" />
    >
    > <ItemTemplate>
    >
    > <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
    > ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%#
    > Eval("ProductURL") %>' />
    >
    > </ItemTemplate>
    >
    > </asp:TemplateField>
    >
    >
    > The problem is that the image appears in it's original size and I
    > want it to be 75px / 75px only
    >
    > Thank you,
    > Samuel


    Just use plain HTML with databinding:

    <a href='<%# Eval("ProductURL") %>'><img src='<%# Eval("ImageFilePath") %>'
    width="75px" height="75px" border="0"></a>

    --

    Riki
    Riki, Dec 11, 2006
    #2
    1. Advertising

  3. Thatk you,

    That works!

    Samuel

    "Riki" <> wrote in message
    news:...
    > Samuel Shulman wrote:
    >> Below is the code that I use
    >> <asp:TemplateField>
    >>
    >> <ControlStyle Height="75px" Width="75px" />
    >>
    >> <ItemStyle Height="75px" Width="75px" />
    >>
    >> <ItemTemplate>
    >>
    >> <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
    >> ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%#
    >> Eval("ProductURL") %>' />
    >>
    >> </ItemTemplate>
    >>
    >> </asp:TemplateField>
    >>
    >>
    >> The problem is that the image appears in it's original size and I
    >> want it to be 75px / 75px only
    >>
    >> Thank you,
    >> Samuel

    >
    > Just use plain HTML with databinding:
    >
    > <a href='<%# Eval("ProductURL") %>'><img src='<%# Eval("ImageFilePath")
    > %>'
    > width="75px" height="75px" border="0"></a>
    >
    > --
    >
    > Riki
    >
    Samuel Shulman, Dec 11, 2006
    #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. Vik
    Replies:
    3
    Views:
    2,242
    Noel Hoo
    Sep 11, 2003
  2. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,255
    Kartic
    Jan 26, 2005
  3. davetichenor
    Replies:
    1
    Views:
    810
    Eliyahu Goldin
    Oct 30, 2006
  4. Ken
    Replies:
    1
    Views:
    365
    Alvin Bruney
    Aug 16, 2003
  5. Dave
    Replies:
    0
    Views:
    928
Loading...

Share This Page