Automatic Refresh of page (using a timer and .reload) causes messagebox.

U

UJ

I have a page with code in it to automatically refresh the page every 30
seconds. Works great. But if I do anything on the page (which resets the
timer) and then it times out to refresh, I get the 'The page cannot be
refreshed without resending the information. Click Retry to send the
information again, or click Cancel to return to the page that you were
trying to view.'

Anybody know of any way to stop that message from coming up?

Like I said - if you don't do anything - it works fine. Make any kind of
change to the page and it produces this error.

TIA.
 
K

Kevin Spencer

The message comes as a result of Refreshing a page that was returned as the
result of a POST Request. IOW, probably as a result of a PostBack. What I
would do is, if the Page is Posted Back, do a Response.Redirect to return
the Page to the client. Of course, you will have to figure out how to
restore the state to the Page in a different way. Session and QueryString
come to mind offhand.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
L

Lucas Tam

I have a page with code in it to automatically refresh the page every 30
seconds. Works great. But if I do anything on the page (which resets the
timer) and then it times out to refresh, I get the 'The page cannot be
refreshed without resending the information. Click Retry to send the
information again, or click Cancel to return to the page that you were
trying to view.'

Anybody know of any way to stop that message from coming up?

Perhaps consider using Javascript remoting to update the page instead.

If you're using ASP.NET 2.0, it's called Client Side Postbacks.

Otherwise take a look at:

http://www.ashleyit.com/rs/
http://www.thycotic.com/dotnet_remotescripting.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Automatic refresh of a user control 1
Reload problem 1
Refresh page error 2
Fw: automatic reload 0
Reload 1
Detecting a page refresh on a GridView RowCommand 0
reload loop 0
auto reload of a page 3

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top