Hi. I have a page which runs a long process. I needed to show a
"please wait" message.
I have found this very nice article:
http://blogs.crsw.com/mark/articles/642.aspx
I used to have this:
<body onbeforeunload="busyBox.Show();">
<iframe id="BusyBoxIFrame" name="BusyBoxIFrame" frameBorder="0"
scrolling="no"></iframe>
<script language="javascript" src="Scripts/BusyBox.js"></script>
<script>
//Instantiate our BusyBox object
//function BusyBox
(id,varName,imageCount,imageNamePrefix,imageNameSuffix,imageDelay,width,height,
url);
var busyBox = new BusyBox("BusyBoxIFrame","busyBox",
4,"gears_ani_",".gif",100,300,175,"BusyBox.aspx");
</script>
.......
The code in "BusyBox.js" can be found at
http://blogs.crsw.com/mark/articles/642.aspx
(I have no place to paste it here).
It worked great. Now I need to use MasterPages, so now I have
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain"
runat="server">
<script language="javascript" type="text/javascript">
window.onbeforeunload = BusyBox.Show();
</script>
.......
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentFooter"
runat="server">
<div id="Div1" style="font-size: small; font-family: Arial"
align="center">
<iframe id="BusyBoxIFrame" name="BusyBoxIFrame" frameBorder="0"
scrolling="no"></iframe>
<script language="javascript" src="Scripts/BusyBox.js"></script>
<script>
var busyBox = new BusyBox("BusyBoxIFrame","busyBox",
4,"gears_ani_",".gif",100,300,175,"BusyBox.aspx");
</script>
</div>
</asp:Content>
No matter where I put the lines
window.onbeforeunload = BusyBox.Show();
and
<script language="javascript" src="Scripts/BusyBox.js"></script>
I have problems:It either says "BusyBox is undefined", either it stops
on
"window.onbeforeunload = BusyBox.Show();"
with the message "Object doesn't support this property or method",
either there's no error, but my "busybox" does not show at all.
I'm really confused now - where should I put these calls ? These calls
were okay (capitalization and all) before trying to make this work in
a "master-content" kind of pages.
Thank you very much.
Alex