HyperLink with an image

S

Samuel Shulman

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
 
R

Riki

Samuel said:
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>
 
S

Samuel Shulman

Thatk you,

That works!

Samuel

Riki said:
Just use plain HTML with databinding:

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top