如何在jquery弹出messgae后执行服务器端点击事件 [英] how to execute server side click event after jquery pop up messgae
问题描述
< script 类型 = text / javascript >
$([id * = btnModalPopup])。live(click,function(){
$(#modal_dialog)。dialog({
title:jQuery Modal Dialog Popup,
按钮:{
OK:function(){
$(this).dialog('close');
}
},
modal:true
});
返回false;
}); < / script >
< div id = modal_dialog style = display:none >
这是一个模态背景popup
< / div >
< asp:按钮 ID = btnModalPopup runat = server 文字 < span class =code-keyword> = 显示模态弹出窗口 OnClick = btnModalPopup_Click / >
以上代码显示J查询弹出消息。工作正常。但是在弹出消息之后我需要执行服务器端代码,如果我从脚本中删除Return False它执行服务器端代码但弹出消息消失。它应该执行后弹出的OK按钮单击
([id * = btnModalPopup])。live(click,function(){
(#modal_dialog)。dialog({
title:jQuery Modal Dialog Popup,
按钮:{
OK:function(){
(this).dialog('close');
}
},
modal:true
});
返回false ;
}); < / script >
< div id = modal_dialog style = display:none >
这是一个模态背景popup
< / div >
< asp:按钮 ID = btnModalPopup runat = server 文字 < span class =code-keyword> = 显示模态弹出窗口 OnClick = btnModalPopup_Click / >
以上代码显示J查询弹出消息。工作正常。但是在弹出消息之后我需要执行服务器端代码,如果我从脚本中删除Return False它执行服务器端代码但弹出消息消失。它应该执行After popup的OK按钮单击
<script type = "text/javascript" >
$("[id*=btnModalPopup]").live("click", function() {
$("#modal_dialog").dialog({
title: "jQuery Modal Dialog Popup",
buttons: {
OK: function() {
$(this).dialog('close');
}
},
modal: true
});
return false;
}); < /script>
<div id="modal_dialog" style="display: none">
This is a Modal Background popup
</div>
<asp:Button ID="btnModalPopup" runat="server" Text="Show Modal Popup" OnClick="btnModalPopup_Click" />
Above Code Shows J query popup Message.It Works fine. but after popup message i need to execute server Side Code if i Remove Return False from the script it execute the server Side Code But Popup message disappears. It should execute After popup's OK button Click
("[id*=btnModalPopup]").live("click", function() {
("#modal_dialog").dialog({ title: "jQuery Modal Dialog Popup", buttons: { OK: function() {
(this).dialog('close'); } }, modal: true }); return false; }); < /script> <div id="modal_dialog" style="display: none"> This is a Modal Background popup </div> <asp:Button ID="btnModalPopup" runat="server" Text="Show Modal Popup" OnClick="btnModalPopup_Click" />
Above Code Shows J query popup Message.It Works fine. but after popup message i need to execute server Side Code if i Remove Return False from the script it execute the server Side Code But Popup message disappears. It should execute After popup's OK button Click
这篇关于如何在jquery弹出messgae后执行服务器端点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!