更新Ajax中的进度栏 [英] Update Progress Bar in Ajax

查看:66
本文介绍了更新Ajax中的进度栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用ajax更新进度栏,但无法正常工作,我正在使用以下代码

Hi,

I am using ajax update progress bar but it not working fine , I am using following code

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
<style type="text/css">
    #progressBackgroundFilter_UpdatePanel
{
	position: fixed;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	overflow: hidden;
	padding: 0;
	margin: 0;
	background-color: #000;
	filter: alpha(opacity=50);
	opacity: 0.5;	
	z-index: 999999998;
}
#processMessage_UpdatePanel
{
	position: fixed;	
	top: expression((document.documentElement.clientHeight - 45)/2 + 'px');
	bottom: expression((document.documentElement.clientHeight - 45)/2 + 'px');
	left: expression((document.documentElement.clientWidth - 200)/2 + 'px');
	right: expression((document.documentElement.clientWidth - 200)/2 + 'px');
	z-index: 999999999;
	background-color: #fff;
	border: solid 1px #105da4;
}
</style>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate>
         <div style="padding-removed 450px;">
          <asp:UpdateProgress AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0" DynamicLayout="true"

          ID="updprgModels" runat="server">
          <progresstemplate>
            <div id="progressBackgroundFilter_UpdatePanel">
            </div>
            <div id="processMessage_UpdatePanel" align="center">
              <br />
              <img alt="progress" src="../Images/loading.gif" />
              Processing...
              <br /><br />
            </div>
          </progresstemplate>
          </div>
          <div><asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
          </div>
        </contenttemplate>

推荐答案

使用ajax和Update Progress Bar时要记住的一些要点:
Scriptmanager必须是第一个控件.它必须出现在所有Ajax控件之前.添加Updateprogress控件后,在工具箱中Ajax的同一部分中添加一个UpdatePanel.
在您的代码中,有许多丢失的标签(scriptmanager,updateprogress的关闭标签)我仍然认为它不起作用
请参阅以下内容以获取更多信息;
http://www.dotnetfunda.com/articles/article733- how-to-use-updateprogress-control-aspnet-ajax.aspx [ http://www.dreamincode.net/forums/topic/119029 -aspnet-ajax-with-continuous-progress-bar/ [ http://msdn.microsoft.com/en-us/library/bb386421.aspx [ ^ ]
some of the points to be remembered while using ajax and Update Progress Bar :
Scriptmanager must be the first control. It must appear before all Ajax controls. After you have added the Updateprogress control, add an UpdatePanel in the same section of Ajax in your toolbox.
In your code there are many missing tags (closing tags for scriptmanager,updateprogress)i dont think it works , anyways
refer the following for more;
http://www.dotnetfunda.com/articles/article733-how-to-use-updateprogress-control-aspnet-ajax.aspx[^]

http://www.dreamincode.net/forums/topic/119029-aspnet-ajax-with-continuous-progress-bar/[^]

http://msdn.microsoft.com/en-us/library/bb386421.aspx[^]


这篇关于更新Ajax中的进度栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆