Click here to Skip to main content
Click here to Skip to main content

Create Modal Popup in Ajax UpdateProgress

By , 27 May 2011
 
I searched the web for a simple trick to create a modal popup during asynchronous update in ASP.NET page but it resulted in very complex programming methods using ASP.NET modalextender, etc. So I decided to do it myself. It's a very simple CSS trick.
 
Modal Div Code
<div style="background-color:Gray;    filter:alpha(opacity=80);    opacity:0.80; width: 100%; top: 0px; left: 0px; position: fixed; height: 800px;">
 
        </div>
 
Div displaying Image
 
<div style="margin:auto;     font-family:Trebuchet MS;filter:alpha(opacity=100);    opacity:1;     font-size:small;     vertical-align: middle; top: auto; position: absolute; right: auto; color: #FFFFFF;">
                <table>
                <tr>
                <td><img src="images/big-roller.gif" alt="Loading"  /></td>
                <td><span style="font-family: Georgia; font-size: medium; font-weight: bold; color: #FFFFFF">Loading..</span></td>
                </tr>
 
                </table>
 
        </div>
 
Page Design
 
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
        AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="10">
    <ProgressTemplate>
        <div style="background-color:Gray;    filter:alpha(opacity=80);    opacity:0.80; width: 100%; top: 0px; left: 0px; position: fixed; height: 800px;">
 
        </div>
          <div style="margin:auto;     font-family:Trebuchet MS;filter:alpha(opacity=100);    opacity:1;     font-size:small;     vertical-align: middle; top: auto; position: absolute; right: auto; color: #FFFFFF;">
                <table>
                <tr>
                <td><img src="images/big-roller.gif" alt="Loading"  /></td>
                <td><span style="font-family: Georgia; font-size: medium; font-weight: bold; color: #FFFFFF">Loading..</span></td>
                </tr>
 
                </table>
 
        </div>
 
    </ProgressTemplate>
    </asp:UpdateProgress>
 
This will display a modal popup simply...

License

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

About the Author

Shishir Shukla
India India
Member
Organisation (No members)

No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionInsufficientmemberMauro Leggieri20 Dec '11 - 0:21 
Adding a div does not make a something "modal".
 
You can still navigate through all the page controls using the TAB key. You must install keyboard and focus handlers to avoid selecting controls that must be disabled by the modal dialog.
 
Regards,
Mauro.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 27 May 2011
Article Copyright 2011 by Shishir Shukla
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid