在PageLoad中添加心肝下代碼(根據(jù)情況,將其添加至PageLoad下的所有事件中還是if(!IsPostBack){}中)
//頁面等待動畫
Response.Write("<base target='_self'>");
Response.Write("<table height=100% width=100% id=mydiv style='CURSOR: wait'>");
Response.Write("<tr><td valign=bottom align=center style='FONT-SIZE: 10pt'> 正在初始化數(shù)據(jù),請等待!</td></tr>");
Response.Write("<tr><td valign=top align=center><img src=../images/default/main/wait.gif></td></tr>");
Response.Write("</table>");
Response.Write("<script language=javascript>function HideWait(){mydiv.style.display = 'none';window.clearInterval();}</script>");
Response.Flush();
//頁面等待動畫結(jié)束
在HTML頁面中,添加<sceipt>try{HideWait();}catch(e){}</script>,以將動畫關(guān)閉
注意:
1、在有框架的頁面中,一定要添加Response.Write("<base target='_self'>");
2、在有文件信息輸出至硬盤上的代碼時,需保證動畫代碼只執(zhí)行一次,否則會報錯
3、對于Model窗體,應(yīng)注意 target='_self'的使用,有時會出錯