Linking to a url from an image in a datagrid

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>
 
L

Lucas Tam

(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?
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top