Link to home
Start Free TrialLog in
Avatar of praveenuni
praveenuni

asked on

Loading -- DIV Tags

Hello,

I'm developing an application which will do several postbacks. Some of them are taking more time. During this time, I want to display "Loading...Please wait" message to the user using DIV tags. How can I do this?

Thanks
Avatar of Jeff Certain
Jeff Certain
Flag of United States of America image

Create a DIV tag and set display=hidden. Use client-side script to make the DIV visible on the button click (before the postback).
Avatar of praveenuni
praveenuni

ASKER

can you please show me how to do that ?

Thanks
SOLUTION
Avatar of Jeff Certain
Jeff Certain
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you very much for the info. I want to show the div on every page load, not only on a button click. So how can I do this?

So you want to show the div during the page load and then hide it once the page is loaded?
yes that is correct.
Create the DIV so it is visible...

<DIV id="divWait" ms_positioning="FlowLayout">Loading....Please wait</DIV>

When the page is done loading, use the client-side javascript to hide the DIV....

<body onload='HideDiv();'>
where should I put this statement: <DIV id="divWait" ms_positioning="FlowLayout">Loading....Please wait</DIV>.

I want to appear this div in the center of the page and how can I control the font size and color for Loading..

Thanks
1. Place it in the HTML whever you want it to appear.

2. You can control the appearance using the STYLE attribute.
I tried this, but in the hide function, its giving page error saying "Object Expected"
Any suggestions
Sounds like it can't find the div called divWait.... have you placed it on the page? Did you keep the same name?
yes, I kept the same name and placed it under the body tag.
use this code .. it should work

<HTML>
.......
<body MS_POSITIONING="GridLayout" onload="javascript:document.getElementById('divWait').style.visibility  = 'hidden';">
        <DIV id="divWait" ms_positioning="FlowLayout">Loading....Please wait</DIV>

This one is working fine. But loading.. tag is not appearing as soon as the user clicks any button or do any postback. It is appearing only after the request and postback completed. It is appearing and disappearing in just a second.

Any suggestions

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note, the response.flush is very important .. also after u do a flush, if u try to redirect to another page, u will get an error ..