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
精彩评论