Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Javascript
I googled about how to lock content page while page post back and got the following code,
 
        function showLoading() {
            var windowWidth = 0;
            var windowHeight = 0;
 
            if ((document.documentElement) && (document.documentElement.clientWidth))
                windowWidth = document.documentElement.clientWidth;
            else if ((document.body) && (document.body.clientWidth))
                windowWidth = document.body.clientWidth;
            else if ((document.body) && (document.body.offsetWidth))
                windowWidth = document.body.offsetWidth;
            else if (window.innerWidth)
                windowWidth = window.innerWidth - 18;
 
            if ((document.documentElement) && (document.documentElement.clientHeight))
                windowHeight = document.documentElement.clientHeight;
            else if ((document.body) && (document.body.clientHeight))
                windowHeight = document.body.clientHeight;
            else if ((document.body) && (document.body.offsetHeight))
                windowHeight = document.body.offsetHeight;
            else if (window.innerHeight)
                windowHeight = window.innerHeight - 18
 

 
            document.getElementById('blackOut').style.display = 'block';
            var height = windowHeight + "px";
            alert(windowHeight + " " + windowWidth);
            document.getElementById('blackOut').style.height = height;
            document.getElementById('blackOut').style.width = windowWidth + "px";
        }
------------------------------------------------------------------------------------------------
and my html "blackout" is as follow
------------------------------------------------------------------------------------------------
 
<div id="blackOut" style="display: none; position: absolute; background-color: black;
        filter: alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; z-index: 999; top: 0px;
        left: 0px; height: 1%; width: 1%; height: 1%;">
        <table width="100%" height="100%">
            <tr>
                <td align="center" valign="middle">
                    <h2 style="color: White; font-weight: bold">
                        Please wait...</h2>
                    <br />
                    <img src="/images/progress2.gif" />
                </td>
            </tr>
        </table>
    </div>
 

 
but the problem is than it do not lock the entire page.
can you please help me to lock entire page while post back.
Posted 31-Mar-13 22:06pm
Edited 31-Mar-13 22:08pm
v2
Comments
manognya kota at 1-Apr-13 4:42am
   
Try changing the width and height of in showloading function
Kalpesh Bhadra at 1-Apr-13 5:35am
   
i dont want to set it manually, bcos page height is not fixed. although i tried to set it as 100% but it didn't locked the entire page.
manognya kota at 1-Apr-13 5:40am
   
Can you tell me where have to set it as 100% and also, currently what portion of the screen is being locked?
Kalpesh Bhadra at 1-Apr-13 6:18am
   
i set style="height:100%" of div id="blackOut" and it works but when i scroll down the remaining page remains same

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Kalpesh Bhadra at 2-Apr-13 3:24am
   
thank you vijay it worked. thanks a ton

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 230
2 BillWoodruff 205
3 Sergey Alexandrovich Kryukov 195
4 DamithSL 165
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,650
3 Kornfeld Eliyahu Peter 3,460
4 Sergey Alexandrovich Kryukov 2,811


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100