tags:

views:

68

answers:

5
+1  Q: 

ASP.NET/AJAX Modal

I want an animation modal (loading please wait) and when the page fully loads it disappears?

Thank you

A: 

Using jQuery:

$(function() { $('#loading').fadeOut(); });

The rest is CSS and an animated GIF.

SLaks
A: 

If you're using jQuery, try something like this:

$(function() {
  var reqMgr = Sys.WebForms.PageRequestManager.getInstance();
  reqMgr.add_beginRequest(ShowWait);
  reqMgr.add_endRequest(HideWait);
});

function ShowWait() { 
  $("#Loading").fadeIn();
}

function HideWait() { 
  $("#Loading").fadeOut();
}

Then just have an element:

<div id="Loading">Loading, Please Wait...</div>

Style and position as you want with css, default it to have a display: none; though.

Nick Craver
A: 

I recommend to write some simple html with your loading message (and may be a page mask to make it grayed) and place it at the beginning of the page. And at the end of page add script to remove that message and mask (see first answer). So users will see this message as soon as they get the html page (also some browsers support rendering of incomplete pages during loading of the page). See the code of this page for additional details.

zihotki
A: 

Hi Jame, have a look at http://malsup.com/jquery/block it's nice and simple to use :)

Jason Roberts