从ImageButton onClick,VB获取CommandArgument [英] get CommandArgument from ImageButton onClick, VB

查看:117
本文介绍了从ImageButton onClick,VB获取CommandArgument的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a series of ImageButtons...when I click on the image, I want to redirect to another page, using the CommandArgument as a uniqueId...How can i get the commandArgument from the onclick event? Thanks!

推荐答案

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

Don't use the OnClick event. Use the OnCommand event

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

这篇关于从ImageButton onClick,VB获取CommandArgument的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆