Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

How to delay page redirect?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gnewsgroup - 04 Dec 2007 04:23 GMT
In my web application, an authenticated user can edit a lot of
personal information and then finally can click on Update/Save button
to save the info.

I did it using MultiView.  When the Update or Save button is clicked,
I would like to bring up a View of the MultiView which only displays
the update progress with a spinner like this one:

http://www.mpire.com/images/sunbox_spinner.gif

And some text to the right saying something like "Your profile is
being updated...."

I would like this UpdateProgress view to stay for 5 seconds and then
either redirect to the very 1st view or output something like "Your
profile has been updated."

I was trying this through System.Threading.Thread.Sleep(5000) in the
button click handler, only to realize that http protocol is stateless,
and thus it won't work.

Right now, I am using the asp:UpdateProgress control just next to the
Update button.  But, it's not nice enough.

So, if I don't wanna redirect to a different page where one can use
meta page refresh property to set the delay timemout, what can we do?
Nick Chan - 04 Dec 2007 04:50 GMT
i wrote a custom UpdateProgress which is transparent and displays on
top of everything in UpdatePanel.
using System.Threading.Thread.Sleep and then output some javascript. I
don't see why Sleep won't work

in the custom updateprogress, i register the script

Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(....

and

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(.....

when init, the control will get the updatepanel dimensions and
position. endrequest will tell my control to execute the function
required to display the progress bar or spin gif.

> In my web application, an authenticated user can edit a lot of
> personal information and then finally can click on Update/Save button
[quoted text clipped - 22 lines]
> So, if I don't wanna redirect to a different page where one can use
> meta page refresh property to set the delay timemout, what can we do?
gnewsgroup - 04 Dec 2007 13:16 GMT
> i wrote a custom UpdateProgress which is transparent and displays on
> top of everything in UpdatePanel.
[quoted text clipped - 12 lines]
> position. endrequest will tell my control to execute the function
> required to display the progress bar or spin gif.

Nick,

Thank you so much, but do you mind giving us more details?  Especially
you left out the parameters for initializeRequest and endRequest.

Also, where do you really register the script?  You said it is in the
custom UpdateProgress control.  I am not sure what it is.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.