私は、この非常に疑問を扱っている多くのスレッドが既に掲載されていることを認識しており、私はそれらの多くを投げ捨てて見て、私の問題にさまざまなアプローチを試みました。残念ながら私は自分の特定の状況で働くことができません。だからここに行く、asp.netのローディング画面
私はVisual Studio 2010で働いているC#とasp.netを使用しています。自分の部門が従業員の指標を追跡するための内部ツールとして、すでにWebサイトを開発しました。プログラムは、ストアドプロシージャを介して中規模のSQLデータベースを打つことによって動作し、次にいくつかのマイナーな計算を行い、ASP:チャート、リピータ、および他のテーブルを含む様々な方法でデータを表示します。プログラムは、ユーザがメトリックを表示したい日付範囲を選択することを可能にする。明らかに範囲が広がるにつれて、ユーザーが経験するハングタイムも増加します。私は、ページがサーバーにポストバックするたびに表示される負荷画面を作成しようとしています。私の最初の考えは、ページロードイベントが発生したときに表示されるローディングGIFでCSSとdivを使用することでしたが、正常に動作するようには見えませんでした。私はjqueryとajaxの多くの例を読んだり見たりしましたが、どちらも経験がありません。私は
$(document).ready(function() {
$('#loadGif').hide();
});
<img id="loadGif" runat="server" src="img/loading.gif" alt="Please wait while the site information is updated" />
と
document.getElementById("loading").className = "loading-visible";
var hideDiv = function() { document.getElementById("loading").className = "loading- invisible"; };
var oldLoad = window.onload;
var newLoad = oldLoad ? function(){hideDiv.call(this);oldLoad.call(this);} : hideDiv;
window.onload = newLoad;
<div id="loading" class="loading-invisible">
<img id="loadGif" runat="server" src="img/loading.gif" alt="Please wait while the site information is updated" />
</div>
およびその他のいくつかのテクニックを試してみました。明らかに、私はこれらのテクニックを適切に使用する方法を理解していません。私が望むのは、ユーザーの要求が処理されていることを知るために、ページがデータをロードしている間にローディング画面を表示することだけです。あなたはこのためにUpdateProgress
コントロールを使用することができるはず
/*--------------------==================LOADING SCREEN=================---------------- -*/
/*this is what we want the div to look like
when it is not showing*/
div.loading-invisible
{
/*make invisible*/
display:none;
}
/*this is what we want the div to look like
when it IS showing*/
div.loading-visible
{
/*make visible*/
display:block;
/*position it 200px down the screen*/
position:absolute;
top:200px;
left:0;
width:100%;
text-align:center;
/*in supporting browsers, make it
a little transparent*/
background:#fff;
filter: alpha(opacity=75); /* internet explorer */
-khtml-opacity: 0.75; /* khtml, old safari */
-moz-opacity: 0.75; /* mozilla, netscape */
opacity: 0.75; /* fx, safari, opera */
border-top:1px solid #ddd;
border-bottom:1px solid #ddd;
}
/*---------------- Another loading screen attempt with ajax---------*/
#updateProgress
{
background-color:#CF4342;
color:#fff;
top:0px;
right:0px;
width:100%;
position:fixed;
}
#updateProgress img
{
vertical-align:middle;
margin:2px;
}
/*---------------- Another loading screen attempt with jquery---------*/
div#spinner
{
display: none;
width:100px;
height: 100px;
position: fixed;
top: 50%;
left: 50%;
background:url(loading.gif) no-repeat center #fff;
text-align:center;
padding:10px;
font:normal 16px Tahoma, Geneva, sans-serif;
border:1px solid #666;
margin-left: -50px;
margin-top: -50px;
z-index:2;
overflow: auto;
}
「CSS」はどこですか? – xandercoded
可能な複製[onclickフォーム送信、フォームが完全に送信されるまでjQueryロードイメージを開く](http://stackoverflow.com/questions/2150730/onclick-form-submit-open-jquery-loading-image-until-form-submit -complete)とhttp://stackoverflow.com/questions/8875107/how-can-i-set-loading-image-during-post-data-processing-for-jquery-ajax – jrummell
何が正しく動作しませんあなたはこれまでに試したことがありますか? Javascriptエラー、間違った動作など? – jrummell