【问题标题】:get CommandArgument from ImageButton onClick, VB从 ImageButton onClick 获取 CommandArgument,VB
【发布时间】:2011-12-18 23:01:09
【问题描述】:

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

【问题讨论】:

    标签: asp.net onclick commandargument


    【解决方案1】:

    不要使用 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
    

    【讨论】:

      猜你喜欢
      • 2016-08-17
      • 1970-01-01
      • 2017-12-08
      • 1970-01-01
      • 2017-04-12
      • 2013-02-17
      • 1970-01-01
      • 2011-12-15
      • 1970-01-01
      相关资源
      最近更新 更多