在asp.net(c#)中怎么实现根据页面加载的情况出现进度条??????

主要是因为查找数据太多而引起的等待,各位大侠能在说说嘛!!!!!

第1个回答  2010-10-25
计算总的数据行数,返回数据~
查找的过程不是会read()么
每read一次就
递加就行了
int num =0;
while(read())
{
//你自己的逻辑
i++;
progressBar.Value = i;
}
第2个回答  2010-10-25
有专门的进度条控件,progressBar
第3个回答  2010-10-25
页面正在载入(js代码)
<!---加载进度条---->
<script type="text/javascript">
<!--

document.write('<div id=divShowLoading style="position:absolute; display:none;">'+
'页面正在载入,请等待<span></span></div>');
function showProcess()
{
GetMsg();
}
var timerId=null;
function GetMsg()
{
var msg = document.getElementById("divShowLoading");
msg.style.left = (document.body.clientWidth - 220) / 2;
msg.style.top = window.screen.height / 3 - 120;
if(window.document.readyState != null && window.document.readyState != 'complete')
{
msg.style.display = "block";
}
else
{
msg.style.display = "none";
window.clearTimeout(timerId);
return;
}
timerId=window.setTimeout('GetMsg()',1000);
}
showProcess();
//-->
</script>
<!---加载进度条---->

===================================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ">
<html xmlns=" ">
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />

</head>

<body>
<!---加载进度条---->
<div id="divShowLoading" style="position:absolute; display:none;">数据正在加载......</div>
<script type="text/javascript">
<!--

function showProcess()
{
GetMsg();
}
var timerId=null;
function GetMsg()
{
var msg = document.getElementById("divShowLoading");
msg.style.left = (document.body.clientWidth - 220) / 2;
msg.style.top = window.screen.height / 3 - 120;
if(window.document.readyState != null && window.document.readyState != 'complete')
{
msg.style.display = "block";
}
else
{
msg.style.display = "none";
window.clearTimeout(timerId);
return;
}
timerId=window.setTimeout('GetMsg()',1000);
}
showProcess();
//-->
</script>
<!---加载进度条---->
</body>
</html>

/////////////////////////////////////////////////////////////////////
<html>
<head>
<title>页面正在载入</title>
<script language=javascript>
<!--
document.write('<div id=loadDiv style="padding-top: 50; padding-left: 50">'+
'页面正在载入,请等待<span id="loading"></span></div>');
var setInterval1 = setInterval("loading.innerText += '.'", 300);
var setInterval2 = setInterval("loading.innerText = ''", 15000);
function window.onload()
{
hiddenDiv.style.display=""; //显示页面内容
loadDiv.removeNode(true);
clearInterval(setInterval1);
clearInterval(setInterval2);
}
// --></script>
</head>

<body>

<div id=hiddenDiv style="display:none">

<!-- 将你的网页所有内容都放在这个div之内即可 -->

</div>

</body>
</html>本回答被提问者采纳
第4个回答  2010-10-25
用AJAX控件就可以

相关了解……

你可能感兴趣的内容

大家正在搜

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网