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 ...
随机推荐
- jQuery-menu-aim 电商菜单栏demo
最近要修改一个电商网站的菜单,引用了jQuery-menu-aim的插件,因此,去找了几个资料: 参考GitHub地址: https://github.com/kamens/jQuery-menu-a ...
- 关于SQL查询某年数据 和DATEPART 函数的使用
数据库查询某年数据(sql server)select *from 表名 where YEAR(存时间的字段名) =某年select *from News where YEAR(addDate) =2 ...
- mac-svn代码管理
一.mac下svn管理代码 //1.打开命令行工具,cd 到要拉取的代码放置位置 //2.从svn上拉取项目代码:svn checkout svn项目地址 (--username=XXX --pass ...
- Java反射【一、概述】
.net也使用过反射,不过用的比较浅显,用来记日志等.. Java基础课程学习已经过了一段时间了,接下来继续学习 本次学习包含以下内容 Java反射[一.概述] Java反射[二.Class类的使用] ...
- odoo 常用模型的简写
<act_window>是窗口操作模型ir.actions.act_window <menuitem>是菜单项模型ir.ui.menu <report>是报表操作模 ...
- win10 修改文件夹右击默认打开程序
1.注册表打开 cmd regedit 2.打开如下位置 3.编辑图中2个Anycode.command的值 为打开 保存即可
- 上班时能不能戴耳机?V
上班时能不能戴耳机? 新入职一公司, 上班时间不能戴耳机在V站一石激起千层浪,网友意见主要分几派: 甩手走人型: 神经病公司,这还不赶紧走 不走等着过年 不走留着转正 离职,下一题 还是赶紧离职吧 这 ...
- TP-LINK WR941N路由器研究
TP-LINK WR941N路由器研究 之前看到了一个CVE, CVE-2017-13772 是TP-Link WR940N后台的RCE, 手头上正好有一个TP-Link WR941N的设备,发现也存 ...
- SQL 语句外键 a foreign key constraint fails
queryRunner.update("SET FOREIGN_KEY_CHECKS = 0;"); queryRunner.update(sql, pid); queryRunn ...
- Python3多线程爬取meizitu的图片
python环境:python3 运行环境:win10和linux都可以,其他系统没测 1 安装依赖 pip install requests pip install lxml pip install ...