开发者

Making image clickable in gridview imagefield

I have an image field in a gridview as this:

<asp:ImageField DataImageUrlField="PictureID" 
       DataIma开发者_运维问答geUrlFormatString="~/UploadedImages/{0}.jpg" HeaderText="Image" 
       ReadOnly="True">
    <ControlStyle Width="100px"  />
</asp:ImageField>

I want when user click on any of the images, it should take them to another page UploadedImage.aspx, displaying the clicked image in full size.

Can someone help me accomplish that?


You might want to use TemplateColumn where you put an ImageButton control in that template and then handle the RowCommand event.


Here's a discussion on the topic, with a few ideas on solutions, such as

  • Handle the onClick-event of the image
  • Inline Javascript
  • Plain old a href

http://forums.asp.net/t/1303912.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜