Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / May 2006

Tip: Looking for answers? Try searching our database.

Visual Studio 2003 'Loses' code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phillip N Rounds - 24 Feb 2006 21:27 GMT
I have had a recurring problem with my VS2003

1: It keeps loosing certain types of code, specifically

   MyButton.Attributes.Add("onclick", "myJavaScriptFunction();");

I add this in the
   private void InitializeComponent() method,  after all the appropriate C#
event handlers are added.

Am I adding it in the wrong place?

I also occasionally lose JavaScript in the HTML.  I've had instances where
all the JavaScript has been wiped out after re-compiling and debugging a
solution.
I've smartened up ( a bit ), and put all my JavaScript in separate files,
but I would like to know if this is a recurrent problem out there and if
there are any fixes.

Thanks

Phil
BobF - 24 Feb 2006 21:41 GMT
> I have had a recurring problem with my VS2003
>
[quoted text clipped - 18 lines]
>
> Phil

If this:
<http://support.microsoft.com/kb/822759/>
doesn't address your problem, see if it is listed here:
<http://search.microsoft.com/results.aspx?q=visual+studio+2003+hotfix&l=1&mkt=en-
US&FORM=QBME1
>
Phillip N Rounds - 24 Feb 2006 22:28 GMT
>> I have had a recurring problem with my VS2003
>>
[quoted text clipped - 25 lines]
> doesn't address your problem, see if it is listed here:
> <http://search.microsoft.com/results.aspx?q=visual+studio+2003+hotfix&l=1&mkt=en-
US&FORM=QBME1
>

Well, I was able to re-create the instance where this hot-fix was supposed
to apply, so I can only hope it works when they get around to sending it to
me.
Thanks for the prompt reply
Michael A. Covington - 26 Feb 2006 14:36 GMT
Are you putting it in something that is rewritten by the designer?
Phill  W. - 28 Feb 2006 13:36 GMT
>I have had a recurring problem with my VS2003
>
[quoted text clipped - 7 lines]
>
> Am I adding it in the wrong place?

IMO, Yes.
The Designer has some *really* bad habits, including trying to
"make sense" of any code like this that it finds in "its" region and,
presumably, just trashing anything it /can't/ make sense of.

The only line of code I put into Designer Generated code is a call to
A.N.Other method that does all this sort of thing, but safely /well away/
from the machinations of the Designer...   :-)

> I also occasionally lose JavaScript in the HTML.
Apparently, this has been *massively* improved in VS'2005 (i.e.
it actually works correctly!) but, sadly, it's just something that
VS'2003 does.

Personally, I /like/ the way I put my HTML together, so I try to
/avoid/ the Designer as far as physically possible (even editing the
HTML source in something less "meddlesome" and just letting
'Studio reload it every time I do.

Regards,
   Phill  W.
David - 23 Apr 2006 08:20 GMT
> I have had a recurring problem with my VS2003
>
[quoted text clipped - 18 lines]
>
> Phil

I've seen this happen to my own codes as well. If you remember the name
of the code, simply go into the property of the object, click on the
little button with the lightning on it and change it back(usually code
like my_button_click_0 would change to something like
my_button_click_0_1). Check it out.
Velvet - 11 May 2006 21:17 GMT
I found that annoying behavior with anything added to the "Code Generated"
parts of the code.  I usually create a SetDefaults() method and add it to
the first line of my Page_Load() method.  The only time I found that it
doesn't work is for dynamically creating the DataGrid columns.  In that
case, the method has to be run before the Init happens.  In that case I add
the method above the following comment:

When it is added there, I don't see it disappear.
//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

>> I have had a recurring problem with my VS2003
>>
[quoted text clipped - 23 lines]
> my_button_click_0 would change to something like my_button_click_0_1).
> Check it out.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.