You could try something like this: Store an integer as Session"LastRequest". Put this into a hidden field on the page. For every request, you add one to the integer On postback, make sure that no other request has been made by checking that Request.
Form"LastRequest" is equal to Session"LastRequest" If you need to check for multiple instances before the postback happens you should be able to do so using AJAX calls.
You could try something like this: Store an integer as Session"LastRequest". Put this into a hidden field on the page. For every request, you add one to the integer.
On postback, make sure that no other request has been made by checking that Request. Form"LastRequest" is equal to Session"LastRequest". If you need to check for multiple instances before the postback happens you should be able to do so using AJAX calls.
Every time you render a form, set the value of some hidden field to random string. Store the same string in Session state. When the user posts back, check if the two values are equal.
If not, this must be a re-post.
You cannot distinguish two http POSTs for the same page even if they are from different tabs. It's like the famous back-button problem - they can post, press back, and repost. The usual solution is hidden tracking fields, but it's very hard to make them reliable.
If it's a wizard-type process, it should be simple to detect if they are overwriting fields that have already been entered, and show a warning.
During the rendering of your specified page, generate a GUID and save in session. Write a generic handler, that keep track that for a specified page, no two GUID exists. Following data structure will help.
Class MultipleOpenedPage{ string guid; string pageURL; DateTime timeStamp; bool IsMultiplePageOpened(List list) { ///logic } }.
– CodingInsomnia Mar 14 '10 at 19:26 In case of GET request, Pressing F5 behaviour is same as opening new instance as in both cases, a new http GET request so there is no easy way to detect. We can detect through ajax request when page unloads but those ajax request sometimes fail.In case of POST refresh, it can be detected by placing a GUID in viewstate and on postback match viewstate GUID with the session value. – Adeel Mar 15 '10 at 6:19.
Because of the stateless nature of the web, I don't believe there is a reliable way to differentiate between two browser windows. However, you can store a flag in Session that a given long running process is in progress. In this way, you don't care if they try to rerun the process from the same browser window or multiple browser windows.
The trick is going to be handling situations where the process fails and doesn't get a chance to reset the flag so that the process can be run again.
If I understand the OP correctly, he doesn't have a single process that takes a long time on the server, but a series of pages that collect a whole lot of information (in Session) that shouldn't be re-initialized/rewritten by pages on a second browser tab. – Hans Kesting Mar 16 '10 at 11:37 Even if that is the case, I still do not believe that there is a means to differentiate different browser windows. What we are discussing is finding a way of storing the state of the user's progress through the multi-page process.
That is one of ideal uses for Session. So, instead of trying to detect how the user got to the state they did, he should simply design the system to react to the state in which it thinks the user is. – Thomas Mar 16 '10 at 14:54 If someone is going to downvote, please provide their reasoning.
– Thomas Mar 13 at 4:15.
I got round this by creating a base class inheriting from System.Web.UI. Page and in the page_load/init event, creating an object containing information specific to the user instance. This was, each new page that's created get's it own instance of the object and can therefore maintain different states/properties which can be used to make distinct edits to data on the same page.
Just a thought as it's a bit of a different way around things.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.