Yah - annoying isn't it? :o)
It's a known bug related (i think) to something in the C# compiler.
Having been caught by this one several times I decided to contact my
friendly Head of MVP. According to the information he gave me, the problem
lies with a non-Microsoft file, and it would require a complete rewrite of
that part of the system. Having spoken to the dev team, he basically said
they wont fix it cos they are too busy with VS2k5!
The solutions offered are outlined below...
1) dont use design mode (hmm...)
2) switch off the autoformating options for the C#. Unfortunately, this also
switches off the thing that creates InitializeComponent, so you have to hand
code all your this.ctrl = System.EventHandler stuff. Quite easy when u get
into it, but still annoying!
Then, buy VS2k5. Of course, you can use the BETA if you're not too worried,
it is fixed in that apparently.
Beware also, it sometimes deletes id="" and runat="server" from your aspx
<title> tag, which can be more tricky to spot!
HTH
Dan
"Maziar Aflatoun" wrote:
Hi everyone,
I'm using VisualStudio 2003 and sometimes when I make changes in the design
view, the code in my InitializeComponent() completely disappears and I have
redefine the Events for that page (.aspx) all over again. Does anyone know
why? and also what's the solution.
Thank you
Maz.