Groups | Blog | Home
all groups > asp.net datagrid control > december 2006 >

asp.net datagrid control : HyperLink with an image



Samuel Shulman
12/6/2006 6:05:06 PM
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

Riki
12/11/2006 4:41:26 PM
[quoted text, click to view]

Just use plain HTML with databinding:

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

--

Riki

Samuel Shulman
12/11/2006 6:39:39 PM
Thatk you,

That works!

Samuel

[quoted text, click to view]

AddThis Social Bookmark Button