I have a survey, where you have to click through several pages with questions. I use a "Next" and a "Previous" button for doing this. I use a session for keeping tabs on my position. However, this is a problem.

I use the button\_click event to increment the page counter, but since this fires *after* the page\_load event, nothing happens on the first click, and for every click thereafter everything is one page behind because the questions are rendered before the counter is incremented.

Is there any way to solve this without using the query-string?

*Comment response 10:15:*

My understanding is that the following happens:

1. The first page loads and the counter is not set. The counter is set to 1. The first page is displayed.
2. The user clicks the "Next" button, firing a postback.
3. The page loads, displaying the same set of questions, because the counter is still on 1.
4. The buttons Click-event is run, incrementing the counter. However, the page is still displaying the old questions.

After this everything is one page behind because the questions are rendered before the click-event is fired, incrementing the page counter.

I'm probably not seeing something obvious here :|