0

我有一系列 ImageButtons...当我单击图像时,我想重定向到另一个页面,使用 CommandArgument 作为 uniqueId...如何从 onclick 事件中获取 commandArgument?谢谢!

4

1 回答 1

5

不要使用 OnClick 事件。使用 OnCommand 事件

Protected Sub ImageButton1_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
    Dim arg As String = e.CommandArgument.ToString()

    ' use arg
End Sub
于 2011-10-31T18:15:16.433 回答