Code
Protected Void Addprogressbar ()
{
try
{< br> string S = (literalcontrol) controls [ 0 ]). text;
}< br> catch
{< br> return ;< BR >}
// Modify record 1
// Display progress bar?
If (Showprogressbar = True )
{
// This. registeronsubmitstatement ("Submit", "tosubmit ();");
String Script = @" <! --
VaR ie5 = (document. All & document. getelementsbytagname );
Function setprogress (v, El)
{
If (ie5 | document. readystate = "" complete "")
{
Filterel = El. Children [0];
Valueel = El. Children [1];
If (filterel. style. pixelwidth> 0)
{
VaR filterbackup = filterel. style. filter;
Filterel. style. Filter = """";
Filterel. style. Filter = filterbackup;
}
Filterel. style. width = V + "" % "";
Valueel. innertext = V + "" % "";
}
}
VaR step = 1;
VaR progressstart = false;
VaR progressnum = 0;
VaR waittime = 10;
VaR onsubmit = false;
Function fakeprogress (EL)
{
If (progressnum> = 99)
{
Setprogress (99, El );
}
Else
{
If (Step >=100)
{
Return;
}
Setprogress (progressnum, El );
Progressnum ++;
If (progressnum> 60)
{
Waittime = waittime + 10;
}
Else if (progressnum> 85)
{
Waittime = waittime + 100;
}
Else if (progressnum> 90)
{
Waittime = waittime + progressnum;
}
Else if (progressnum> 95)
{
Waittime = waittime + progressnum;
}
Window. setTimeout ("" fakeprogress (document. All [\ '"" + El. ID + "" \']) "", waittime );
}
}
Function showprogress ()
{
Try {form1.style. Display = 'none';} catch (Ex ){}
If (progressstart = true) {waittime = 50; progressnum = 0; return ;}
Invalid parameters Doc ument. All. progresspanle. style. Display = """";
Progressstart = true;
Fakeprogress(window.doc ument. All. Progress );
}
Window. onbeforeunload = showprogress;
Function overprogress (){
Step = 100; setprogress (100, too many Doc ument. All. Progress );
Window. setTimeout ("" setprogress (100, too many Doc ument. All. Progress) "", 0 );
}
// Window. onUnload = overprogress;
// --> " ;
String Javascriptstr = @" <SCRIPT type = "" text/JavaScript ""> " ;
Javascriptstr + = Script + @" </SCRIPT> " ;
String Hideformtable = @" <Div id = "" progresspanle "" style = "" Left: 35%; top: 45%; display: none; position: absolute; width: 30%; "" border = 0>
<Font style = "" font-size: 9pt; color: black; Height: 10px ""> processing... </font>
<Div id = "" progress "" style = "" border: darkgray 1px solid; Background: white; width: 100%; Height: 16px; text-align: Left ">
<Div id = "" sbchild1 "" style = "" filter: alpha (opacity = 0, finishopacity = 100, style = 1, startx = 0, starty = 0, finishx = 100, finishy = 0); width: 0%; position: absolute; Height: 14px ">
<Div style = "" font-size: 1px; Background: highlight; width: 100%; Height: 100%; ""> </div>
</Div>
<Div style = "" font-size: 12px; width: 100%; color: Silver; font-family: Arial; position: absolute; text-align: center ""> 0% </div>
</Div> " ;
(Literalcontrol) controls [0]). Text+ =Hideformtable;
(Literalcontrol) controls [controls. Count- 1]). Text+ =Javascriptstr;
}
}