我怎样才能按钮的命令参数? [英] how can i get the button's command argument?

查看:118
本文介绍了我怎样才能按钮的命令参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能获得在JavaScript按钮的命令参数。我不想操纵它,我只是想读它。

Is it possible to get a button's command argument in javascript. I don't want to manipulate it, i just want to read it.

如果可能的 - 如何

推荐答案

请自己的属性,并把它与标准的JavaScript:

Make your own attribute and get it with standard JavaScript:

标记:

<asp:LinkButton ID="LinkButton1" cmdname="test" CommandName="test" CommandArgument="1" 
    runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>

脚本:

//however you choose to get the element, jQuery...etc
document.getElementById('<%=LinkButton1.ClientID %>').cmdname

这篇关于我怎样才能按钮的命令参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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