如何在jquery弹出messgae后执行服务器端点击事件 [英] how to execute server side click event after jquery pop up messgae

查看:85
本文介绍了如何在jquery弹出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屋!

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