title: Page.Init and Page.PostBack
body: <p>I know this is a very basic question, but I cannot find the answer.  There are lots of web pages that say page.init does not fire on a post back e.g. here: <a href="http://www.dotnetfunda.com/interview/exclusive/x3224-what-is-the-difference-between-the-pageinit-and-pageload-events.aspx" rel="nofollow">http://www.dotnetfunda.com/interview/exclusive/x3224-what-is-the-difference-between-the-pageinit-and-pageload-events.aspx</a>.  Please see the code below:</p>
  
  <pre><code>Public Class _Default
      Inherits System.Web.UI.Page
  
      Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
          MsgBox("Test Init") 'Line 5
      End Sub
  
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          If Page.IsPostBack = True Then
              MsgBox("PostBack") 'line 9
          End If
          MsgBox("Test Load")
      End Sub
  
      Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
          TextBox1.Text = "Hello"
      End Sub
  End Class
  </code></pre>
  
  <p>The message box on line 5 and line 9 fire every time I click the button.  This means that the Init event is fired on a postback.  I have obviously forgotten something very basic.</p>