在PageLoad中添加心肝下代碼(根據(jù)情況,將其添加至PageLoad下的所有事件中還是if(!IsPostBack){}中)
//頁面等待動(dòng)畫
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ù),請(qǐng)等待!</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();
//頁面等待動(dòng)畫結(jié)束
在HTML頁面中,添加<sceipt>try{HideWait();}catch(e){}</script>,以將動(dòng)畫關(guān)閉
注意:
1、在有框架的頁面中,一定要添加Response.Write("<base target='_self'>");
2、在有文件信息輸出至硬盤上的代碼時(shí),需保證動(dòng)畫代碼只執(zhí)行一次,否則會(huì)報(bào)錯(cuò)
3、對(duì)于Model窗體,應(yīng)注意 target='_self'的使用,有時(shí)會(huì)出錯(cuò)