读书人

关于AJAX控件updateprogress解决思路

发布时间: 2013-11-11 14:02:17 作者: rapoo

关于AJAX控件updateprogress

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lheader" runat="server" Font-Bold="True" Font-Size="Large" Text="使用UpdateProgress控件"></asp:Label><br />
<hr />
 </div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Label ID="linfo" runat="server" Text="单击下面按钮进行测试"></asp:Label><br />
<asp:Button ID="btTest" runat="server" OnClick="btTest_Click" Text="测试" /><br />
<asp:Label ID="lResult" runat="server"></asp:Label>
</contenttemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<progresstemplate>
<div id="iLoading" style="font-weight: bold; font-size: large; left: 20px; text-transform: capitalize; color: red; font-family: Monospace; position: absolute; top: 50px; background-color: #99ccff;">
<img src="images/ajax-loader.gif" />
<img src="images/ajax-loader.gif" /></div>
</progresstemplate>
</asp:UpdateProgress>
</form>
</body>
</html>
protected void btTest_Click(object sender, EventArgs e)
{
//设置延迟时间,以便能显示UpdateProgress控件
System.Threading.Thread.Sleep(60000);
string strMsg = "欢迎访问IT在中国http://www.itzcn.com<br >";
strMsg += "当前时间是:" + DateTime.Now.ToString();
lResult.Text = strMsg;
}

点击测试按钮后却没有看到updateprogress里面的图片显示出来 怎么回事?
[解决办法]
请不要使用微软的ajax控件,请自己写javascript代码创建xmlhttprequest对象来做
[解决办法]
请不要使用微软的ajax控件,请自己使用jQuery来写Ajax

读书人网 >asp.net

热点推荐