This is due to the way you handle PostBacks .
A small background is needed:
The network is "stateless", which means that every request from a client to a server does not depend on a request before it or a request after it. There is no "state." If you look at the HTTP layer, it's just a text block sent to a server that says “send me this information” and the server will send it back. There is no "I am the same user who was here 3 minutes ago, and I would like to go to the next page with the one I was in the last time we spoke."
How ASP.NET solves this problem uses ViewState and postbacks. Each time you click the ASP.NET button, it actually represents a form that has a hidden field with a bunch of encoded data. This data contains all the information that the server needs to "restore" the state of the page, as it was the last time. He can then perform the “go to next page”, and this command makes sense. When ASP.NET sends HTML back to the client, it updates this hidden field with new data, again representing the page state as it is now. And the next time you press any button, the data is sent again, the page is restored again, and the cycle repeats.
When the user clicks Refresh, the browser asks them if they want to resubmit the form. They re-execute the same data as the last time.
Implications for you:
If you try to track any data about a user or what they do regardless of the ASP.NET ViewState, you will need to make sure that you synchronize it every time the page is processed.
You probably want to save the "current page" in the ViewState:
ViewState.Add("CurrentPage", intCurrentPage);
Therefore, when you call the MoveNext event handler, you can be sure that you are in relation to the page, since this was the last time it was sent to the client.
Rex m
source share