Linking to a url from an image in a datagrid

  • Thread starter Thread starter Colin Graham
  • Start date Start date
C

Colin Graham

hi guys,

i have a datagrid which contains several records each of which has an
image. i want to be able to click on the image and open the image in a
larger version in a separate window. At present this works fine. my
issue is that the asp:hyperlink tag as opposed to the asp:image tag
displays images in the grid at their normal size and not at the size i
specify e.g. Width="70" Height="50" - see below.

does anyone know of a way around this ????

thanks in advance

<asp:TemplateColumn HeaderText="Image">
<ItemTemplate>
<asp:hyperlink ImageUrl='<%#
FormatURL(DataBinder.Eval(Container.DataItem, "product_image")) %>'
Width="70" Height="50" NavigateUrl=www.tes.com Runat=server
ID="Image1"/>
</ItemTemplate>
</asp:TemplateColumn>
 
(e-mail address removed) (Colin Graham) wrote in
my
issue is that the asp:hyperlink tag as opposed to the asp:image tag
displays images in the grid at their normal size and not at the size i
specify e.g. Width="70" Height="50" - see below.

Try adding the control in the ItemDataBound event handler of the
datagrid... it might work better if it's in code?
 
Back
Top