Visual Studio change my code

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 .. ?
 
A

AW

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top