いくつかのオプションがあります。AJAX Control Toolkit
と UpdateProgress コントロールを使用するか、またはjQuery
を使用してデータベース呼び出しを使用して呼び出すことができます。 WebMethod
Web Service
AJAX Control Toolkit
http://www.asp.net/ajax/documentation/live/overview/UpdateProgressOverview.aspx
jQuery implementation
[WebMethod]
public void PerformDatabaseOperation() {
// Your database code here
}
へのリクエストを実行するにはWeb Method
:
$.ajax({
type: "POST",
url: "./YourPage.aspx/PerformDatabaseOperation",
error: function(XMLHttpRequest, textStatus, errorThrown){
alert(textStatus);
},
success: function(result){
alert("success");
}
});
div
メッセージのプレースホルダーとして が必要です。
<div id="LoadingMessage">
Please wait....
</div>
$('#LoadingMessage').hide()
.ajaxStart(function() {
$(this).show();
})
.ajaxStop(function() {
$(this).hide();
});
データベース呼び出しを実行するたびに、読み込みメッセージが表示されます。