弹出警报处于活动状态时禁用所有控件和母版页 [英] Disable all controls and master page while popup alert is active

查看:63
本文介绍了弹出警报处于活动状态时禁用所有控件和母版页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试显示弹出警报,当它处于活动状态时,我不希望用户与表单或母版页中的其他项目(已锁定)进行交互。怎么可能?



 function ShowPendingTimeoutDialog(){

diag.dialog({
autoOpen:false,
title:Session About to Expire,
position:{my:center center,at:center center,of:#pagecontainer},
closeText:hide,
可调整大小:false,
draggable:false,
modal:true,
按钮:{
继续:function(){
ResetTimeout();
}
}

});





我从某人手中接过这个,所以我不知道这是否是我需要处理的代码?



谢谢,

rami

解决方案

您可以使用jQuery UI生成模态弹出窗口,还有其他插件可以执行相同的操作谷歌为他们



https://jqueryui.com/dialog/ #modal-message [ ^ ]



主页



 < ;%@     Master    语言  =  C#    AutoEventWireup   =  true    CodeBehind   =  MySite.master.cs   继承  =  WebApplication1.MySite   %>  

< !DOCTYPE html >

< html xmlns = http: //www.w3.org/1999/xhtml\">
< head runat = 服务器 >
< title > 我的网站< / title >

< link rel = stylesheet href = https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css\" / < span class =code-keyword>>

< script src = https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js < span class =code-keyword>> < / script >
< script src = https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js < span class =code-keyword>> < / script >

< asp:ContentPlaceHolder ID = head runat = server >
< / asp:ContentPlaceHolder >
< / head >
< 正文 >
< 表格 id = form1 runat = 服务器 >
< div >
< asp:ContentPlaceHolder ID = ContentPlaceHolder1 < span class =code-attribute>
runat = server >

< / asp:ContentPlaceHolder >
< / div >
< / form >

< div id = dialog-message title = 我的留言 >
< p >
Hello world
< / p >
< / div >

< script type = text / javascript >
var dialog =


#dialog-message)。dialog( {
autoOpen: false
modal: true
}) ;


document )。ready( function (){

I am trying to display a popup alert and when it is active, i don't want the user to interact with other items in the form or the master page (locked). How is it possible?

function ShowPendingTimeoutDialog() {
        
            diag.dialog({
                autoOpen: false,
                title: "Session About to Expire",
                position: { my: "center center", at: "center center", of: "#pagecontainer" },
                closeText: "hide",
                resizable: false,
                draggable: false,
                modal: true,
                buttons: {
                    Continue: function() {
                       ResetTimeout();
                    }
                }

            });



I took this from someone so i don't know if this is the code that i need to work on?

thanks,
rami

解决方案

You can use jQuery UI to generate modal pop-ups, there are other plug-ins that do the same if you google for them

https://jqueryui.com/dialog/#modal-message[^]

Master page

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MySite.master.cs" Inherits="WebApplication1.MySite" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>My Site</title>

    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> 

    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>

    <div id="dialog-message" title="My Message">
        <p>
            Hello world
        </p>
    </div>

    <script type="text/javascript">
        var dialog =


("#dialog-message").dialog({ autoOpen: false, modal: true });


(document).ready(function () {


这篇关于弹出警报处于活动状态时禁用所有控件和母版页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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