Funky
Funky

Reputation: 13612

JQuery - ASP.NET postback "loading" gif - is it possible?

just wondering, is it possible to have a "loading" gif while the page is posting back?

Cheers

Upvotes: 1

Views: 4177

Answers (3)

Nathan
Nathan

Reputation: 1923

I have found this post which exactly solves your (and mine for that matter) problem. I've only tested this in Internet Explorer though, so don't shoot me if it's not cross browser compatible.

(if indeed some other browsers completely stop javascript from executing this will be of no help I would think)

'+ it seems to be super-hacky to me :-)

Upvotes: 0

Alan Feekery
Alan Feekery

Reputation: 978

I literally just blogged about how to do this, I have been working out a solution for the last few hours, you will have to use a loading.aspx page: http://alanfeekery.com/post/8510926813/how-to-maintain-a-gif-animation-after-a-page-postback

If you want to stay on the same page though (presuming your using webforms), the built in Ajax controls are the way to go. You can use an UpdatePanel to wrap content that will be changed and an associated UpdateProgress panel to bring up loading informtion and in your case your gif animation.

Upvotes: 0

Oded
Oded

Reputation: 499002

You can start a "loading" animation in javascript (by binding to the form submit event).

However, some browsers will stop javascript processing as soon as the new request starts or as soon as a response starts.

In other words, since this is a full postback, no not possible.

Investigate using AJAX for partial page updates.

Upvotes: 1

Related Questions