title: Having to press an asp.net button twice
body: <p>I have a button that sets a session variable when clicked.  But for some reason, I have to click it twice in order for the save to actually happen.  Is there anyway around this?</p>
  
  <p>Thanks</p>
  
  <pre><code>     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
       If CInt(Session("save")) &lt;&gt; 1 Then
          'save something ...
       End If
  
       End Sub
  
  
       Private Sub btnSave_Click(sender As Object, e As System.EventArgs) Handles btnSave.Click
             Session("save") = 1
       End Sub
  </code></pre>