When you create a form with Visual Studio.NET, did you ever notice the
following comment that is added before the InitializeComponent Sub?
'NOTE: The following procedure is required by the Form Designer
'Do not modify it using the code editor.
You are doing exactly what it tells you not to do and then you are
frustrated by the outcome.
I suggest you move your custom code into some other place such as Page_Init
or Page_Load.
To be fair, you aren't the only one that's been confused by this and that's
why Microsoft is moving all that "no-touch" stuff into separate files in
Visual Studio 2005, so people won't be so tempted to muck with it and then
end up frustrated like you.
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"David Cho" <pr********@yahoo.com> wrote in message
news:ep**************@TK2MSFTNGP09.phx.gbl...
I've noticed that my code in InitializeComponent where I am linking
event handlers to events vanishes from time to time.
One of the things that triggers the disappearance is when I do something
wrong the the aspx page, causing an "Error Creating Control" error.
It's not always reproducible, but when I do that, some of the lines of
code in InitializeComponent vanish without warning.
Is this a "feature" from Microsoft? Is there a way to prevent that if
that is indeed a "feature"?
It is beyond frustrating because often it happens after my code has been
deployed and customers complain about buttons failing to respond. There
is no way I can audit every line of code in InitializeComponent to make
sure it has remained intact.
*** Sent via Developersdex http://www.developersdex.com ***