Button.OnClientClick
Button.OnClientClick
Gets or sets the client-side script that executes when a Button control's Click event is raised.
[System.Web.UI.Themeable(false)]
public virtual string OnClientClick { get; set; }
Property Value
Remarks
Use the OnClientClick property to specify additional client-side script that executes when a Button control's Click event is raised.
The script that you specify for this property is rendered in the Button control's OnClick
attribute in addition to the control's predefined client-side script.
This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.
效果
<input type="submit" name="ctl00$cphMain$btnAction" value="OK" onclick="if(!MassUpdateConfirm()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$cphMain$btnAction", "", true, "Action", "", false, false))" id="ctl00_cphMain_btnAction">
如果想要自己在C#中拼接的话
string script = @"
var control=
$('.blueimp-file-upload-submit').on('click',function(e) {
e.preventDefault();
e.stopPropagation();
var previews = $('.preview');
$.each(previews, function(){
var data = $(this).data('data');
data.submit();
});
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(`""${this.name}""`, """", true, ""Action"", """", false, false));
});";
Button.OnClientClick的更多相关文章
- GridView中使用如下button OnClientClick代码会出现解析错误
在GridView中使用如下代码会出现解析错误: <asp:LinkButton ID="DeleteButton" runat="server" Cau ...
- ASP.NET页面回车键触发Button按钮事件问题
首先了解一下Button.UseSubmitBehavior属性. 获取或设置一个布尔值,该值指示 Button 控件使用客户端浏览器的提交机制还是 ASP.NET 回发机制. 如果该控件使用了客户端 ...
- ASP.NET服务器控件OnClientClick事件中Eval()作为js方法的参数的一种写法
参考代码: <input type="button" OnClientClick='<%#Eval("DeptID", "DelUserD ...
- asp.net 下OnClientClick的妙用
一. OnClick是button的服务器端事件 OnClientClick是button的客户端事件 onlick时发生postback,执行后台代码.onclientclick,就是执行javas ...
- asp.net onclientclick事件刷新页面问题解决
做网页经常要和JavaScript打交道,经常要用JavaScript做一些客户端的验证,但是如果我们的按钮用的是HTML控件的话,验证通过后无法调用后台代码,如果用服务器端控件,验证不通过有要刷 ...
- 实现在点击asp:button按钮后,不刷新当前页面
方法1:return false <asp:Button ID="Button1" runat="server" Text="Button&qu ...
- webform button
https://www.codeproject.com/Questions/412553/differences-between-onClick-and-onClientClick OnClick w ...
- onclientclick与onclick的问题.
<script language="javascript" type="text/javascript"> document.getElementB ...
- 为ASP.NET按钮(Button)添加确认对话框
http://www.cnblogs.com/blodfox777/articles/1261303.html Button有两个点击事件: onclick 触发服务端事件,脚本为c#或VB.NET ...
随机推荐
- 创建LEANGOO看板
转自:https://www.leangoo.com/leangoo_guide/leangoo_guide_create_kanban.html#toggle-id-3 Leangoo使用看板来管理 ...
- 工控漏洞利用框架 - ISF(Industrial Security Framework)
一. 框架介绍 本框架主要使用Python语言开发,通过集成ShadowBroker释放的NSA工具Fuzzbunch攻击框架,开发一款适合工控漏洞利用的框架.由于Fuzzbunch攻击框架仅适用于P ...
- SQL语句复习【专题六】
SQL语句复习[专题六] 用户 + 创建表 --创建一个新的用户,然后给新的用户创建一张表,然后给表中添加一些数据.查询表中的数据 --创建用户需要比较大的权限 DBA create user di ...
- deep_learning_Function_list变量前面加星号,字典变量前面加两个星号
列表前面加星号作用是将列表解开成两个独立的参数,传入函数, 字典前面加两个星号,是将字典解开成独立的元素作为形参. def add(a, b): return a+b data = [4,3] pri ...
- 基于docker安装pxc集群
基于docker安装pxc集群 一.PXC 集群的安装 PXC集群比较特殊,需要安装在 linux 或 Docker 之上.这里使用 Docker进行安装! Docker的镜像仓库中包含了 PXC数据 ...
- linux基础—课堂随笔04_文件查找和压缩
文件查找和压缩 文件查找 1.locate 这个命令是对其生成的数据库进行遍历(生成数据库的命令:updatedb),这一特性决定了用locate查找文件速度很快,但是locate命令只能对文件进 ...
- Datasets and Evaluation Metrics used in Recommendation System
Movielens and Netflix remain the most-used datasets. Other datasets such as Amazon, Yelp and CiteUli ...
- RAID的多种实现
RAID的诞生 由加利福尼亚大学伯克利分校(University of California-Berkeley)在1988年,发表的文章:"A Case for Redundant Arra ...
- nodejs基础一
Node.js是一个基于Chrome V8引擎的JavaScript运行. js的运行环境 运行js有两种: .js文件方式 交互(REPL): node 回车进入交互模式 .exit 退出交互模式 ...
- 【51nod 1847】奇怪的数学题
题目描述 给出 N,K ,请计算下面这个式子: \(∑_{i=1}^N∑_{j=1}^Nsgcd(i,j)^k\) 其中,sgcd(i, j)表示(i, j)的所有公约数中第二大的,特殊地,如果gcd ...