VB Code:
  1. Dim str As String
  2.  
  3.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         'Put user code to initialize the page here
  5.  
  6.         If Page.IsPostBack Then
  7.             str = ViewState("str")
  8.         Else
  9.             str = "Init"
  10.         End If
  11.  
  12.         Response.Write(str)
  13.  
  14.     End Sub
  15.  
  16.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  17.         str = TextBox1.Text
  18.         ViewState("str") = str
  19.     End Sub
When the page first loads, obviously "Init" prints. Then, I type in TextBox1 and click Button1. You would think that on the first PostBack, str would be printed but it isn't. It's not until the next Button1 click. So my question is, does the Page PostBack fire before the Button Click event fires? Seems to be backwards if that's the case...