I have a problem with maintaining a variable during event handling, and here's what I think the situation is:
1) I set a random number in a page_load.
2) Upon a button click, I have a routine to check and see if the number typed = the random number generated in step 1.
The problem is, the submit button click regenerates a new number (by triggering a page_load event) before the routine in step 2 has a chance to do what it needs to do. Therefore, the chances that the two numbers are = are very slim.
Is there a keyword or something that tells vb to execute the routine in #2 before the page_load event is called?
Thanks.
1) I set a random number in a page_load.
2) Upon a button click, I have a routine to check and see if the number typed = the random number generated in step 1.
The problem is, the submit button click regenerates a new number (by triggering a page_load event) before the routine in step 2 has a chance to do what it needs to do. Therefore, the chances that the two numbers are = are very slim.
Is there a keyword or something that tells vb to execute the routine in #2 before the page_load event is called?
Thanks.