473,387 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Code disappears from under InitializeComponent()

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.
Nov 19 '05 #1
1 1013
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.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jack | last post by:
The code at the bottom is obfuscated c and was a category winner of the 1989 IOCCC http://www.ioccc.org/1989/roemer.c Does anyone have a trick to make it compile under g++? Thanks. char...
8
by: edster | last post by:
A *lot* of our teams code is being deleted from the InitializeComponent() section of a winform, such as Grid settings, event handler hooks, layout settings etc. This mainly seems to happen to 3rd...
6
by: Winshent | last post by:
I have read many threads which indicate that this was a problem with version 2002. Why should i be suffering this? I am using VB.NET 2003 Standard Edition... is it still a problem with 2003? ...
1
by: jing | last post by:
Hi all. here is the source file: http://www.cs.aau.dk/~simas/tpr/tpr1.1.zip btw, the compiler is gcc 3.3.1 just for research use. any help would be most appreciated.
8
by: Jack | last post by:
Hi, This code I inherited worked under VC7 now fails under VC8 with error: error C2664: 'memcpy' : cannot convert parameter 1 from 'std::_Vector_iterator<_Ty,_Alloc>' to 'void *' vector...
2
by: Phoe6 | last post by:
Hi all, I have this Code Context feature under Options in the IDLE. How should I use it? Are there folks here who use it regularly and find it useful. Please guide me. Thanks! Senthil
1
by: jeffm | last post by:
Has anyone experienced an Access Database losing all of its vb code? This is the second time I Have seen this happen and have no explanation. All module,form,and report code gone!
2
by: sush_jd via DotNetMonster.com | last post by:
I am using managed VC++ code in a Win Form App. There is a text box - txtRONumber. I have defined a KeyDown event handler (non-default) for it, like below. InitializeComponent() is being called...
2
by: gtfrueh | last post by:
I have a VB6 project that runs OK under XP, but not under Win98. I have not packaged and deployed. I just copied my working folder of code from the XP machine to the Win98 machine. The code on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.