我们可以在一个复选框上触发两个事件,点击一个来自javascript,另一个来自codebehind [英] Can we fire two events on a single check box click one from javascript and other from codebehind
本文介绍了我们可以在一个复选框上触发两个事件,点击一个来自javascript,另一个来自codebehind的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<asp:checkbox ID="chkheader" runat="server" onchangeclicked="checkbox clicked">
<asp:checkbox ID="chkrows" runat="server" onchangeclicked="checkbox clicked">
($document.ready(function(){
$('#gridview1').find(input:checkbox[id$="chkAll"]).click(function(){
-----do something
}
Codebehind
protected void checkbox clicked(object sender,EventArgs e)
{
----do something
}
I need both events to fire on checkbox click. Is it possible??
What I have tried:
<asp:checkbox ID="chkheader" runat="server" onchangeclicked="checkbox clicked">
<asp:checkbox ID="chkrows" runat="server" onchangeclicked="checkbox clicked">
($document.ready(function(){
$('#gridview1').find(input:checkbox[id$="chkAll"]).click(function(){
-----do something
}
Codebehind
protected void checkbox clicked(object sender,EventArgs e)
{
----do something
}
I need both events to fire on checkbox click. Is it possible??
推荐答案
document.ready(function(){
document.ready(function(){
( '#gridview1')。find(输入:checkbox [id
('#gridview1').find(input:checkbox[id
=chkAll])。click(function(){
-----做点什么
}
Codebehind
protected void复选框点击(对象发送者,EventArgs e)
{
----做点什么
}
我需要在复选框点击时触发两个事件。有可能吗?
="chkAll"]).click(function(){ -----do something } Codebehind protected void checkbox clicked(object sender,EventArgs e) { ----do something } I need both events to fire on checkbox click. Is it possible??
What I have tried:
<asp:checkbox ID="chkheader" runat="server" onchangeclicked="checkbox clicked">
<asp:checkbox ID="chkrows" runat="server" onchangeclicked="checkbox clicked">
(
这篇关于我们可以在一个复选框上触发两个事件,点击一个来自javascript,另一个来自codebehind的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文