Click here to Skip to main content
15,892,575 members
Articles / Web Development / XHTML

Lock ASP.NET Page and Show Animated Image While Waiting for a Long Post-Back

Rate me:
Please Sign up or sign in to vote.
4.83/5 (35 votes)
9 Apr 2009CPOL4 min read 266K   11.1K   119  
Lock page while post back
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/* Menu & MenuBar styles */

.yuimenu {

    top: -999em;
    left: -999em;

}

.yuimenubar {

    position: static;

}

.yuimenu .yuimenu,
.yuimenubar .yuimenu {

    position: absolute;

}

.yuimenubar li, 
.yuimenu li {

    list-style-type: none;    

}

.yuimenubar ul, 
.yuimenu ul,
.yuimenubar li, 
.yuimenu li,
.yuimenu h6,
.yuimenubar h6 { 

    margin: 0;
    padding: 0;

}

.yuimenuitemlabel,
.yuimenubaritemlabel {

    text-align: left;
    white-space: nowrap;

}


/* 
    The following style rule trigger the "hasLayout" property in 
    IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a
    MenuBar instance's <ul> element, allowing both to clear their floated 
    child <li> elements.
*/

.yuimenubar ul {

    *zoom: 1;

}


/* 
    Remove the "hasLayout" trigger for submenus of MenuBar instances as it 
    is unnecessary. 
*/

.yuimenubar .yuimenu ul {

    *zoom: normal;

}

/*
    The following style rule allows a MenuBar instance's <ul> element to clear
    its floated <li> elements in Firefox, Safari and and Opera.
*/

.yuimenubar>.bd>ul:after {

    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    height: 0;
    line-height: 0;

}

.yuimenubaritem {

    float: left;

}

.yuimenubaritemlabel,
.yuimenuitemlabel {

    display: block;

}

.yuimenuitemlabel .helptext {

    font-style: normal;
    display: block;
    
    /*
        The value for the left margin controls how much the help text is
        offset from the text of the menu item.  This value will need to 
        be customized depending on the longest text label of a menu item.
    */
    
    margin: -1em 0 0 10em;
    
}

/*
    PLEASE NOTE: The <div> element used for a menu's shadow is appended 
    to its root element via JavaScript once it has been rendered.  The 
    code that creates the shadow lives in the menu's public "onRender" 
    event handler that is a prototype method of YAHOO.widget.Menu.  
    Implementers wishing to remove a menu's shadow or add any other markup
    required for a given skin for menu should override the "onRender" method.
*/

.yui-menu-shadow {

    position: absolute;
    visibility: hidden;
    z-index: -1;

}

.yui-menu-shadow-visible {

    top: 2px;
    right: -3px;
    left: -3px;
    bottom: -3px;
    visibility: visible;

}


/*

There are two known issues with YAHOO.widget.Overlay (the superclass class of 
Menu) that manifest in Gecko-based browsers on Mac OS X:

    1) Elements with scrollbars will poke through Overlay instances floating 
       above them.
    
    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
       visible when the Overlay is hidden.

To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):

    1) The "overflow" property of a Menu instance's shadow element and child 
       nodes is toggled between "hidden" and "auto" (through the application  
       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
       as its "visibility" configuration property is toggled between 
       "false" and "true."
    
    2) The "display" property of <select> elements that are child nodes of the 
       Menu instance's root element is set to "none" when it is hidden.

PLEASE NOTE:  
  
    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
       applied only for Gecko on Mac OS X and are added/removed to/from the 
       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
    
    2) There may be instances where the CSS for a web page or application 
       contains style rules whose specificity override the rules implemented by 
       the Menu CSS files to fix this bug.  In such cases, is necessary to 
       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
       write custom style rules to guard against this bug.

** For more information on this issue, see:

   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
   + SourceForge bug #1723530

*/

.hide-scrollbars * {

	overflow: hidden;

}

.hide-scrollbars select {

	display: none;

}


/*

The following style rule (".yuimenu.show-scrollbars") overrides the 
".show-scrollbars" rule defined in container-core.css which sets the 
"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to 
"auto" when it is visible.  Without this override, a Menu would have scrollbars
when one of its submenus is visible.

*/

.yuimenu.show-scrollbars,
.yuimenubar.show-scrollbars {

	overflow: visible; 

}

.yuimenu.hide-scrollbars .yui-menu-shadow,
.yuimenubar.hide-scrollbars .yui-menu-shadow {

    overflow: hidden;

}

.yuimenu.show-scrollbars .yui-menu-shadow,
.yuimenubar.show-scrollbars .yui-menu-shadow {

    overflow: auto;

}

.yui-overlay.yui-force-redraw {
   margin-bottom: 1px;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Web Developer TrafficTech
Canada Canada
Have technical skills that can be demonstrated and an ability to resolve complex problems quickly while working in a demanding, high pressure environment

Designs, plans, and coordinates software development work teams

Provides technical mentorship to project team members

Handles complex application features and technical designs for the development of new applications.

Write articles about ASP.net:
http://www.codeproject.com/KB/aspnet/SQLHelper20.aspx http://www.codeproject.com/KB/aspnet/DateAndTimePicker.aspx http://www.codeproject.com/KB/aspnet/SQLHelper20.aspx http://www.codeproject.com/KB/aspnet/WaitImageBoxWhilePagePost.aspx

Designs and implements the components, frameworks and layers required for complex application features

Understands and participate in all aspects of the Software Development Life Cycle

Relies on experience and judgment to plan and accomplish goals.

Ability to perform various programming activities (coding, testing, debugging, documenting, maintaining and supporting).

Ability to work independently with minimal supervision.

10 years’ experience in web software design and development.

SpecialtiesASP.net
SQL 2005
AJAX 1.0
Linq
C# 3.5
Microsoft Application Blocks
Java Script
Reporting Services
SQL SSIS
XML
Classic ASP

Comments and Discussions