martedì 20 settembre 2011

UpdateProgress centrato dinamicamente


<script language="JavaScript" type="text/javascript">
        function adjustDivs() {           
            interno = document.getElementById('divCalcolaInterno');
            esterno = document.getElementById('divCalcola');
            dfs = interno.style;
           
            dfs.left = (esterno.innerWidth - interno.offsetWidth) / 2;
        }

        window.onload = adjustDivs;
        window.onresize = adjustDivs;
        window.onscroll = adjustDivs;
<script>

<asp:UpdatePanel ID="updXXX" runat="server">
<ContentTemplate>
       […]
<ContentTemplate>
<asp:UpdatePanel>

<asp:UpdateProgress ID="updprogXXX" runat="server" AssociatedUpdatePanelID="updXXX" DisplayAfter="150">
<ProgressTemplate>
             <div id="divCalcola" align="center" style="top: 200px; position: absolute; top:0; bottom:0; right:0; left:0;background-color:rgba(0,0,0,0.5)">
                    <div id="divCalcolaInterno" align="center" style="border: solid 1px #000000; background: #FFFFFF;padding: 5px; width: 320px; height: 50px;margin-top:300px">
                        <asp:Label runat="server" ID="lblLoading2" Text="Calcolo del fatturato in corso..."><asp:Label>
                        <asp:Image ID="imgLoading2" runat="server" ImageAlign="left" SkinID="imgLoadingBar" /><br /><br />
                        <asp:Label runat="server" ID="lblLoadingInfo" Text="Questa operazione potrebbe durare diversi minuti" Font-Size="X-Small" >asp:Label>
                    <div>
                <div>               
        <ProgressTemplate>
<asp:UpdateProgress>

Nessun commento: