Quote:
Originally posted by Lord_Rat
One more thing:
Page load ALWAYS executes before any event handlers do. Therefore, if you are having a problem because you do not see your message onscreen until the second click, it's not a problem with clicking twice. It's because you are response.writing before you set the variable.
Page Loads first time:
Page Load executes, no session exists, blank output
Button is clicked:
Page Load executes, no session exists, blank output
Button Event Handler executes, session created, but not outputted since the PageLoad already executed before this step.
Button clicked again:
Page Load executes. Session exists this time, is outputted.
Button Event Handler executes again, session variable recreated.
You should make an ASP:Label and in both, the page load and the button event handler, change the .text property to reflect the value of that session variable.