怎样响应在datalist中的imagebutton的单击事件
我在datalist里面放了个imagebutton,已经绑定好了数据库,我想问一下,
当我单击imagebutton时,要打开另一个新页面,新页面只是显示imagebutton里的
那张图片,这是怎样写?
我这样写的,但是inagebutton的单击事件只是弹出个aaaaaaa的对话框
Private Sub DLpro_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DLpro.ItemDataBound
If (e.Item.ItemType = ListItemType.Item) Then
Dim aaa As ImageButton = e.Item.FindControl("ImageButton1")
aaa.Attributes.Add("onclick", "return confirm('aaaaaaaaa');")
End If
End Sub
我在网上查到这样的一个功能,不知道能不能用它来完成我那个功能呢?
Attributes.Add("事件","JS执行代码");