ASP.NET 응용 프로그램에 대한 좋은 페이지로드 진행바를 알고 계십니까?
-
03-07-2019 - |
문제
C# .NET 앱의 사용 가능한 진행률 표시 줄을 본 사람이 있는지 궁금합니다. 내 앱은로드하는 데 약 20-60 초가 걸리고 사용자가 기다리는 동안 진행률 표시 줄을 보여주고 싶습니다. 나는 보았다 이 하나 그러나 샘플 사이트는 자신감을 불러 일으키지 않는 것이 효과가없는 것 같습니다.
해결책
당신은 사용할 수 있습니다 Ajax UpdateProgress 컨트롤.
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress runat="server" id="PageUpdateProgress">
<ProgressTemplate>
Loading...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" id="Panel">
<ContentTemplate>
<asp:Button runat="server" id="UpdateButton" onclick="UpdateButton_Click" text="Update" />
</ContentTemplate>
</asp:UpdatePanel>
애니메이션을 원한다면 애니메이션 .gif를 'ProgressTemplate'에 팝업하기 만하면됩니다.
다른 팁
나는이 블로그 게시물을 조사 할 것입니다 - 좋은 방법 인 것 같습니다. 나는 그것을 직접 테스트하지 않았다 ...
http://mattberseth.com/blog/2008/05/aspnet_ajax_progress_bar_contr.html
ASPX 페이지 에서이 글을 작성해야합니다. 저는 귀하가 정의해야 할 특정 CSS 클래스를 추가했습니다. FuncTinality이 코드가 도움이 될 것입니다.
<asp:Panel ID="ProgressIndicatorPanel" runat="server" Style="display: none" CssClass="modalPopup">
<div id="ProgressDiv" class="progressStyle">
<ul class="ProgressStyleTable" style="list-style:none;height:60px">
<li style="position:static;float:left;margin-top:0.5em;margin-left:0.5em">
<asp:Image ID="ProgressImage" runat="server" SkinID="ProgressImage" />
</li>
<li style="position:static;float:left;margin-top:0.5em;margin-left:0.5em;margin-right:0.5em">
<span id="ProgressTextTableCell"> Loading, please wait... </span>
</li>
</ul>
</div>
</asp:Panel>
함수 정의 say progressIndicator를 다음과 같이 정의하십시오
var ProgressIndicator = function (progPrefix) {
var divId = 'ProgressDiv';
var textId = 'ProgressTextTableCell';
var progressCss = "progressStyle";
if (progPrefix != null) {
divId = progPrefix + divId;
textId = progPrefix + textId;
}
this.Start = function (textString) {
if (textString) {
$('#' + textId).text(textString);
}
else {
$('#' + textId).text('Loading, please wait...');
}
this.Center();
//$('#' + divId).show();
var modalPopupBehavior = $find('ProgressModalPopupBehaviour');
if (modalPopupBehavior != null) modalPopupBehavior.show();
}
this.Center = function () {
var viewportWidth = jQuery(window).width();
var viewportHeight = jQuery(window).height();
var progressDiv = $("#" + divId);
var elWidth = progressDiv.width();
var elHeight = progressDiv.height();
progressDiv.css({ top: ((viewportHeight / 2) - (elHeight / 2)) + $(window).scrollTop(),
left: ((viewportWidth / 2) - (elWidth / 2)) + $(window).scrollLeft(), visibility: 'visible'
});
}
this.Stop = function () {
//$("#" + divId).hide();
var modalPopupBehavior = $find('ProgressModalPopupBehaviour');
if (modalPopupBehavior != null) modalPopupBehavior.hide();
}
};
Conatins에게 Modal, i : e가있는 진행 지표를 제공 한 예. 진행 상황 표시기가 실행될 때 화면에서 수행 할 다른 작업을 비활성화합니다. 필요하지 않은 경우 모달 부품을 제거 할 수 있습니다.
제휴하지 않습니다 StackOverflow