Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Refresh and postback
12-07-2004, 11:21 PM #1
- Join Date
- Nov 2004
- The land of chocolate
- Thanked 16 Times in 16 Posts
Refresh and postback
Yeah, it's me and my newbie questions again.
For an ASP.NET assignment, I am making a quiz with random questions. The question should only change when the user presses the button, so in order to keep the same question on the screen when the user reloads the page, I tried to put my code between an "if not IsPostBack"-check. I always assumed a simple refresh returned IsPostBack to true.
But in contrast to what I assumed, IsPostBack returns false even if the user simply refreshes the page. I thought you had to completely renew the page for that (by closing the window or adding a space to the URL or something like that).
Since a refresh is apparently not a postback, is there any way to get around this? I suspect cookies might do the trick, but I am not sure.
Last edited by snowieken; 12-07-2004 at 11:26 PM.