首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ASP.NET网站中添加加载窗口,类似于Silverlight中的子窗口

在ASP.NET网站中添加加载窗口,类似于Silverlight中的子窗口
EN

Stack Overflow用户
提问于 2012-02-06 19:56:42
回答 2查看 966关注 0票数 1

我有一个用C# / ASP.NET编写的网站。我尝试在页面加载时添加加载/等待窗口。我如何在Asp.net中做到这一点?谢谢..

EN

回答 2

Stack Overflow用户

发布于 2012-02-06 20:19:58

我用DOJO解决了这个问题。我使用了dijit.dialog。下面是我的代码的一部分:

代码语言:javascript
复制
<head>
<!-- api's (you can use also google apis: https://ajax.googleapis.com/ajax/libs/dojo/1.6.1/dojo/dojo.xd.js) -->
    <link href="<%=Url.Content("~/Scripts/dojo/dijit/themes/tundra/tundra.css")%>" rel="stylesheet"
        type="text/css" media="screen" />
    <link href="<%=Url.Content("~/Scripts/dojo/dojo/resources/dojo.css")%>" rel="stylesheet"
        type="text/css" media="screen" />
     <script djconfig="parseOnLoad: true" type="text/javascript" src="<%=Url.Content("~/Scripts/dojo/dojo/dojo.js")%>"> </script>
</head>

<script type="text/javascript">

dojo.require("dijit.Dialog");
dojo.require("dijit.layout.ContentPane");


// This is the function to show the spinning whell (or something else to demonstrate the loading progress)

    function wheelShow() {
        var dialog = new dijit.Dialog({ title: "Loading...", id: "wheel" });
        dialog.setContent("<img style='height: 55px; width: 55px; text-align:center' src='../../Content/images/loader.gif' />");
        dialog.show();
        // hiding of close button in dialog
        dojo.query("#wheel .dijitDialogCloseIcon").forEach(function(node, index, arr) {
            node.style.visibility = "hidden";
        });
    }
</script>

<body class="tundra">
    <!-- after the page will be completly loaded - hide the wheel -->
    <div id="delayedContent" onload="dijit.byId('wheel').hide()">


<!-- your page content here... -->


    </div>
</body>
票数 1
EN

Stack Overflow用户

发布于 2012-02-07 21:32:20

我找到了类似的东西。它看起来使用起来简单实用:

http://www.codeproject.com/Articles/42344/AJAX-Enabled-MessageBox

顺便说一下,谢谢你的回答。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9159724

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档