我现在是想做一个页面载入,当一个页面上的数据没有加载完毕那么显示一张loading的图片,如果一个页面的数据加载完毕,那么就显示页面。 关键是,怎么判断一个.aspx页面上所有的数据是否加载完毕,我知道怎么去判断iframe中的类容,但不知道怎么去判断一个单独的页面上所有的类容。最好帮我来段代码。越想希望好,才接触asp.net.比较急,麻烦个位大侠、帮小弟看看,谢谢各位了。
解决方案 »
- asp.net链接数据库异常!!求救
- 菜鸟发问 100分回报
- 时间日期问题,请帮忙!
- 照着书上写了个tree,可老是提示如下错误信息~~~同志们,怎么搞啊~请赐教啊~~:)
- 500分求解:Windows XP SP2 和 Windows 2003 ASP。NET远程调试的问题。
- 真晕 像MSDN上这样的是怎么做出来的
- DataGrid的一个有一定难度的问题(在线等)
- 如何把一个表单提交给一个弹出页
- 如何将String值转换为“System.Web.UI.WebControls.Unit”?
- ===???遇到难题了e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#a9a9a9';this.style.color='buttontext';
- asp.net换台机器数据连接不上了
- 数据库中含有html格式的数据如何在页面中显示
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form runat="server"><div id="LoadingDiv" style="display:block;width:250px; font-size:13px; background-image:url('img/loading.gif'); background-repeat:no-repeat; height:39px; background-position:center; text-align:center;"></div>
<div id="LoadingFrmdiv" style="display:none;">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
<ContentTemplate>
<iframe src="http://www.hao123.com" width="500px;" height="900px;" id="ice" onreadystatechange="if(this.readyState=='complete'){ document.getElementById('LoadingDiv').style.display='none';
document.getElementById('LoadingFrmdiv').style.display='block';}"></iframe>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
但怎么去判断单一一个页面,是否加载完毕了?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" ></asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
请稍后.....
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
<cc1:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" runat="server" TargetControlID="updatePanel1">
<Animations>
<OnUpdating>
<Parallel duration="0">
<%-- place the update progress div over the gridview control --%>
<ScriptAction Script="onUpdating();" />
</Parallel>
</OnUpdating>
<OnUpdated>
<Parallel duration="0">
<%--find the update progress div and place it over the gridview control--%>
<ScriptAction Script="onUpdated();" />
</Parallel>
</OnUpdated>
</Animations>
</cc1:UpdatePanelAnimationExtender>
<asp:Panel ID="pnlPopup" runat="server" style="display:none;">
Loading, please wait...
<img src="images/activity.gif" />
</asp:Panel>
UpdatePanelAnimationExtender 表示在某个特定的面板中数据更新的时候该面板显示出来的动画效果
脚本如下:
function onUpdating() {
// get the update progress div
var pnlPopup = $get('<%= this.pnlPopup.ClientID %>'); // get the gridview element
var gridView = $get('<%= this.GridView1.ClientID %>'); // make it visible
pnlPopup.style.display = ''; // get the bounds of both the gridview and the progress div
var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
var pnlPopupBounds = Sys.UI.DomElement.getBounds(pnlPopup); // center of gridview
var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(pnlPopupBounds.width / 2);
var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(pnlPopupBounds.height / 2); // set the progress element to this position
Sys.UI.DomElement.setLocation(pnlPopup, x, y);
} function onUpdated() {
// get the update progress div
var pnlPopup = $get('<%= this.pnlPopup.ClientID %>');
// make it invisible
pnlPopup.style.display = 'none';
}
</script>
document.onreadystatechange = endLoad;
function endLoad()
{
if (document.readyState=="complete")
{
... ...
}
}
你这个里面的控件<cc1:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" runat="server" TargetControlID="updatePanel1">是什么控件?我怎么都没有找到?