代償文件:
システムを使用しています。
System.Collections を使用します。
System.ComponentModel を使用します。
System.Data を使用します。
System.Drawing を使用します。
System.Web を使用します。
System.Web.SessionState を使用します。
System.Web.UI を使用します。
System.Web.UI.WebControls を使用します。
System.Web.UI.HtmlControls を使用します。
System.Threading を使用します。
名前空間 AjaxTest
{
/**//// <概要>
/// WebForm2 の要点説明。
/// </概要>
パブリック クラス WebForm2 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(オブジェクト送信者、System.EventArgs e)
{
Response.Write("<div id='mydiv' >");
Response.Write("_");
Response.Write("</div>");
Response.Write("<script>mydiv.innerText = '';</script>");
Response.Write("<script language=javascript>;");
Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");
Response.Write("{var 出力; 出力 = '正在装填页面';dots++;if(dots>=dotmax)dots=1;");
Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText = Output;}");
Response.Write("関数 StartShowWait(){mydiv.style.visibility = 'visible'; ");
Response.Write("window.setInterval('ShowWait()',1000);}");
Response.Write("関数 HideWait(){mydiv.style.visibility = 'hidden';");
Response.Write("window.clearInterval();}");
Response.Write("StartShowWait();</script>");
Response.Flush();// これが最も重要です
private
void Button1_Click(オブジェクト送信者, System.EventArgs e)
{
//当ポイントが有効な場合、設定要求には長い時間がかかります (ここでは 10 秒に設定されています)
System.Threading.Thread.Sleep(10000);
this.Label1.Text = "终以加ダウンロード完了啦";
代
コード#region Web ボディ デザイナーが生成した代コード
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: この調整は ASP.NET Web ボディ デザイナーに必要です。
//
InitializeComponent();
Base.OnInit(e);
}
/**//// <概要>
/// デバイスのサポートに必要な方法 - 不要な代码编辑器修正
/// このメソッドの内容。
/// </概要>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += 新しい System.EventHandler(this.Page_Load);
}
#エンドリージョン
}
}
页面文件:
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="AjaxTest.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<頭>
<title>Webフォーム2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content=" http://schemas.microsoft.com/intellisense/ie5 ">
<スクリプト>
HideWait();
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" Method="post" runat="server">
<FONT face="宋体">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 480px; POSITION: 絶対; TOP: 200px" runat="server"
Text="ボタン"></asp:ボタン>
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 632px; POSITION: 絶対; TOP: 240px" runat="server">ラベル</asp:Label></FONT>
</form>
</body>
</HTML>
http://fanrsh.cnblogs.com/archive/2006/06/14/425888.html