Visual Studio change my code

  • Thread starter Thread starter Ola Johansson
  • Start date Start date
O

Ola Johansson

I have made a custom "Pagebase" class that i inherits from all my web
form pages.

In my InitializeComponent method on each page i have added a "AddHandler
Me.Load, AddressOf Page_Load".

The problem is that each time i view my page in the designer VS.net
removes my "AddHandler Me.Load, AddressOf Page_Load". And add "Handles
MyBase.Load" on the "Page_Load" method.

This would be ok if im was the only developer in the project but if
other people should work with my page this can be a problem.

Anyone have any ideas how to fix this .. ?
 
Just read what Visual Studio.net places at the top of the
InitializeComponent method:
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.

I would suggest placing your code in response to the Init event instead.
 
Back
Top