Recognizing Page Refresh in On_Unload

A

Areric

Hey all,

Does anyone know how i can detect a refresh of the page in the unload
event on the server?

The problem I'm having is that refresh automatically calls the previous
event that happened via a postback. So if you click save in our app,
itll call save again if you refresh. I would like to grab that refresh
and have it execute a different command which clears out the screen and
repopulates the latest data (i.e. a real refresh) but i need to know
how to recognize the refresh in unload.
 
J

Jesse Houwing

Areric said:
Hey all,

Does anyone know how i can detect a refresh of the page in the unload
event on the server?

The problem I'm having is that refresh automatically calls the previous
event that happened via a postback. So if you click save in our app,
itll call save again if you refresh. I would like to grab that refresh
and have it execute a different command which clears out the screen and
repopulates the latest data (i.e. a real refresh) but i need to know
how to recognize the refresh in unload.

After your safe, just redirect to the page itself. That way the user
will get a 'fresh' history item which an be refreshed as many times as
you'd want. Another solution is to keep some kind of dictionary of pages
you've seen in the last session (based upon a unique number in the
viewstate for example) and cancel all event in case you're seeing the
same number twice.

Jesse
 

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

Top