Page_Init and Page_Load

Viewed 14411

A page containts custom address control and checkBox. Why does the second example of code work properly, but first doesn't?

//1
protected void Page_Init(object sender, EventArgs e)
{
  //doesn't work properly
   ucLegalAddress.Visible = !chkLegalAddress.Checked;
}


 //2
 protected void Page_Load(object sender, EventArgs e)
  {
    //works properly
     ucLegalAddress.Visible = !chkLegalAddress.Checked;
   }
2 Answers
Related