views:

218

answers:

1

Hi. I have a Home.html that has a login form that POSTS to login.aspx the login.aspx takes a hell lot of time to load...

so i want to have a javascript based function where the instant i click Login Button, a loader must be shown ...while in the background the POST happens and then aspx page must get loaded and then the modal must redirect to the aspx page.

similar to gmail.com login loader..... but only using javascript. (i am also using a minified jquery js ) (NO aspx pages in between)

Please note that i cannot use any asp based loader!

I have tried using :

http://blogs.msdn.com/naitik/archive/2008/07/31/show-loading-message-while-web-page-is-processing.aspx
(it does not work fast. it first redirects to the POSTed page )

Thanks in advance..

A: 

If you just want to show a "Please wait...", attach yourself to the forms "onsubmit" event. Then show the "please wait" message (make a DIV visible). When you are done, the form will be submitted and wait for login.aspx.

If you want to have a progress bar, you have two ways of doing it: * Either post to a hidden iframe which will load login.aspx. * Or use an XmlHttpRequest to load login.aspx.

In both cases, login.aspx has to spit out messages (pieces of JScript or DIVs you interpret on the client) which update your progress bar.

You will find plenty of examples in Google. Try "jscript progress bar aspx" for instance.

René

Krumelur