Ajax
An application here is perfect for updateprogress applications. Designed to give the user a better display of results. You can refer to the effect:
http://szhxy.gliet.edu.cn/qxgl/the update procedure displayed by the login.
The code is as follows:
<%@ Page language= "C #" autoeventwireup= "true" codefile= "Default.aspx.cs" inherits= "_default"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd XHTML 1.1//en" "Http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
<style type= "Text/css" >
#UpdatePanel1 ... {
width:300px;
height:100px;
Border:solid 1px Gray;
}
</style>
<title> Update Test </title>
<body>
<form id= "Form1" runat= "Server" >
<asp:scriptmanager id= "ScriptManager1" runat= "Server" enablepagemethods= "true" enablescriptglobalization= "true" >
</asp:ScriptManager>
<div visible= "false" >
<asp:updateprogress id= "UpdateProgress1" runat= "Server" associatedupdatepanelid= "UpdatePanel1" displayafter= "0" >
<ProgressTemplate>
<div id= "Progress" style= "border:1px solid RGB (73, 138, 194); padding:0px; z-index:1000; margin-top:20%; margin-left:30%; width:229px; Position:absolute; height:94px; Background-color:rgb (255, 255, 255); Border-collapse:collapse; left:206px; top:129px; " >
<table cellpadding= "4" cellspacing= "0" style= "width:100%; height:100%; " >
<tr>
<TD style= "HEIGHT:26PX; Text-align:left; Background-image:url (tile_back.gif); Text-align:left; " >
<span style= "Font-size:9pt;color: #ffffff" > <strong> system Tips </strong></span></td>
</tr>
<tr>
<TD valign= "Middle" style= "height:100%;text-align:center; Vertical-align:middle; " >
<br/>
<br/>
<span style= "font-size:9pt" > is processing, please ......</span></td> later
</tr>
</table>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
<asp:updatepanel id= "UpdatePanel1" runat= "Server"
<contenttemplate>
Password: <asp:textbox id= "TextBox2" runat= "Server" ></asp:textbox
<br/>
Password Confirmation: <asp: TextBox id= "TextBox1" runat= "Server" ></ASP:TEXTBOX>
< Asp:button id= "Button1" runat= "Server" text= "button"/>
</contenttemplate>
</asp:UpdatePanel>
</form>
</body>
CS Code:
Using System;
Using System.Data;
Using System.Configuration;
Using System.Web;
Using System.Web.Security;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.WebControls.WebParts;
Using System.Web.UI.HtmlControls;
public partial class _default:system.web.ui.page
... {
protected void Page_Load (object sender, EventArgs e)
... {
}
protected void Button1_Click (object sender, EventArgs e)
... {
System.Threading.Thread.Sleep (3000);
int j = 0;
for (int i = 0; i < 100000000; i++)
... {
j = i+j;
}
if (TextBox1.Text.Equals (TextBox2.Text))
... {
Response.Redirect ("/login.aspx");
}
Else
... {
Response.Redirect ("/error.aspx");
}
}
}
However, according to the study, Http://szhxy.gliet.edu.cn/qxgl/Login.aspx?ReturnUrl=%2fqxgl%2fDefault.aspx uses the following methods:
He implements the image display by calling the HTM file.
Replace the form code with the following:
<iframe scrolling= "No" frameborder= "0" marginwidth= "0" marginheight= "0" src= "bar.htm"/></iframe>
Visible also need a bar.htm. So we'll build a:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title> System Tips </title>
<body style= "margin:0px" >
<table cellpadding= "4" cellspacing= "0" style= "width:100%; height:100%; " >
<tr>
<TD style= "HEIGHT:26PX; Text-align:left; Background-image:url (tile_back.gif); Text-align:left; " >
<span style= "Font-size:9pt;color: #ffffff" > <strong> system Tips </strong></span></td>
</tr>
<tr>
<TD valign= "Middle" style= "height:100%;text-align:center; Vertical-align:middle; " >
<br/>
<br/>
<span style= "font-size:9pt" > is processing, please ......</span></td> later
</tr>
</table>
</body>
Test passed