Hi,
I am migrating from ASP.NET 1.1 and I used to subscribe to page events using designer which adds subscriptions to InitializeComponent method on the page.
In the ASP.NET 2.0, how can I subscribe to Page events from the designer?
Not using designer this seems to work.
protected void Page_Init(object sender, EventArgs e) {
// The code, no safety here, just convention
}
// OR
protected override void OnInit(EventArgs e) {
base.OnInit(e);
// The code
}
What is the recommended way of subscribing to page events? Same question applies to the MasterPage.
Additionally what is the best way to subscribe to events on the UserControl? When I declare the Page_XXX on the UserControl the event gets called many times.