Hi,
I've been trying to figure it out for days (literaly), plz help. I want to have have a modal popup show with a message (page is loading) until all the scripts/images/texts have been fully loaded onto the page. Need it as on slow modems, if a page doesn't fully load and a user clicks a button... well... it doesn't achieve the required results....
I've got as far as to call the function AFTER everything has loaded (by calling in in the body tag: <body onload="$find('programmaticModalPopupBehavior').show();">) but it doesn't work the other way around, say if i call the script at any other place (except the button), say right under the body tag (or even right before </body>), popup doesn't pop....
Plz help,
Cheers,
Alexi
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="FinalTryModal.aspx.vb" Inherits="FinalTryModal" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.modalBackground {
background-color:Blue;
filter:alpha(opacity=30);
opacity:0.3;
}
.modalPopup {
background-color:white;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
width:250px;
}
</style>
</head>
<body onload="$find('programmaticModalPopupBehavior').hide();">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<script type="text/javascript">
$find('programmaticModalPopupBehavior').show();
</script>
<center><img src="http://apod.nasa.gov/apod/image/0304/bluemarble2k_big.jpg"></center>
<asp:Button ID="Button1" runat="server" OnClientClick="$find('programmaticModalPopupBehavior').show();" Text="Button" />
<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" style="display:none"/>
<cc1:ModalPopupExtender runat="server" ID="programmaticModalPopup"
BehaviorID="programmaticModalPopupBehavior"
TargetControlID="hiddenTargetControlForModalPopup"
PopupControlID="programmaticPopup"
BackgroundCssClass="modalBackground"
DropShadow="True"
PopupDragHandleControlID="programmaticPopupDragHandle"
RepositionMode="RepositionOnWindowScroll" >
</cc1:ModalPopupExtender>
<asp:Panel runat="server" CssClass="modalPopup" ID="programmaticPopup" style="display:none;width:350px;padding:10px">
<asp:Panel runat="Server" ID="programmaticPopupDragHandle" Style="cursor: move;background-color:#DDDDDD;border:solid 1px Gray;color:Black;text-align:center;">
Processing... Please Wait...
</asp:Panel>
<br />
<div style="text-align:center;"><img src="updating.gif" /></div>
</asp:Panel>
</form>
<script type="text/javascript">
$find('programmaticModalPopupBehavior').show();
</script>
</body>
</html>