I want to make my own page load event instead of by default " Page_Load() " .The new event can be any name like MyPage_Load().It can be done by making AutoEventWireup = "false" and by
registering new event , where I need to register this new event.
I think it may possible by editing code in Designer.cs for the specific page , but i am not getting it in ASP.NET 2.0. How can I find Designer.cs and it's event in ASP.NET 2.0.
Thanks
Supreet HVRPosted Apr 24, 2007, 9:28 AM
If I understood your requirement correctly you want to change the delegate to the Load event of your page.
Open your WebForm1.aspx.cs file , you have a method InitializeComponent in WebDesigner generated code, where this event is suscribed. you could change this to any name you like.
private void InitializeComponent()
{
//this.Load += new System.EventHandler(this.Page_Load);
this.Load += new System.EventHandler(this.MyPage_Load);
}
Not checked it in .NET 2.0 but chances are that it is same.