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 / IDE / February 2005

Tip: Looking for answers? Try searching our database.

Events etc randomly deleted from "Web Form Designer generated code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen Davies - 21 Feb 2005 01:51 GMT
We are having a severe problem with Visual Studio 2003. When modifying items
in the form designer or working with the html for data in the designer, the
control events are being deleted from the InitializeComponent method of Web
Form Designer generated code. This is driving us crazy and the ctrl-z key
while in code mode is being overworked to retrieve the data.

We have heard of a hotfix for Visual Studio 2002 but nothing is mentioned
about Visual Studio 2003.

Signature

Regards
Stephen Davies

"Peter Huang" [MSFT] - 21 Feb 2005 09:08 GMT
Hi,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Stephen Davies - 21 Feb 2005 09:31 GMT
Thanks Peter

Seems like a relatively common problem. I have found many postings on
exactly the problem but no answers.

Regards
Stephen Davies

> Hi,
>
[quoted text clipped - 11 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
Gary Chang[MSFT] - 22 Feb 2005 07:18 GMT
>Seems like a relatively common problem. I have found many postings on
>exactly the problem but no answers.

yes Stephen, this is a known issue to the VS.NET 2003.

Generally, the InitializeComponent method is manipulated by the Form
Designer, and the code in InitializeComponent method will be regenerated by
the Web Form Designer now and then, so it will delete your custom code,
however this behavior is by design and I am afraid we don't have a hotfix
for this issue targeting VS.NET 2003:
http://support.microsoft.com/kb/822759

In this scenario, I suggest you to put your custom code out of the
InitializeComponent method, and add it in the function which calls the
InitializeComponent method instead??

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Stephen Davies - 22 Feb 2005 08:47 GMT
> Generally, the InitializeComponent method is manipulated by the Form
> Designer, and the code in InitializeComponent method will be regenerated by
> the Web Form Designer now and then, so it will delete your custom code,
> however this behavior is by design and I am afraid we don't have a hotfix
> for this issue targeting VS.NET 2003:
> http://support.microsoft.com/kb/822759

I am not directly inserting code into this block, I have a component that
creates properties on the page which can be modified. These properties are
stored by the IDE in the said section with all of the other events and
properties.

Not sure that the IDE puts it in there, and then deletes it, by design.

> In this scenario, I suggest you to put your custom code out of the
> InitializeComponent method, and add it in the function which calls the
> InitializeComponent method instead¡­

As mentioned above the IDE puts the code in there not me.

> Thanks for your understanding!

don't really understand, the problem is really annoying, I will follow up re
the hotfix in the page you sent me thanks for checking it out.  

Regards
Stephen Davies
demi - 22 Feb 2005 14:04 GMT
I have the same problem.  And I concur, it happens on
InitializeComponent methods that do not have any custom code i them.  I
have a couple of pages that use DeveloperExpress ASPxGrid version 2 (I
think it happens on other pages as well that contain a regular
DataGrid).  I have several events hooked up to the grid.  Every once in
a while the page stops working.  When I look I discover that it's
because the contents of the InitializeComponent method are cleared out
by the IDE.  Luckily, I'm using VSS and I go back to a previous version
and copy and paste it back, but it's annoying.

I'm not 100% sure, but I think it happens when you edit the ASPX file
source directly then switch to design mode.  Maybe the page has
something on it that confuses the IDE when switching and causes it to
remove the events from the InitializeComponent.  Not sure.
John Barnes - 22 Feb 2005 17:57 GMT
I'm working on a VB.NET Win Forms project and have the same problem.
However, it only happens when I have shared controls on the form
Gary Chang[MSFT] - 23 Feb 2005 03:39 GMT
>I am not directly inserting code into this block, I have a component that
>creates properties on the page which can be modified. These properties  
>are stored by the IDE in the said section with all of the other events and
>properties.
>...

yes Stephen, the KB822759 is also applied to this scenario. For VS.NET
2003, I think contact our Product Support Services  would be a good choise.

By the way, this problem will disppear in the VS.NET 2005(Whidbey), we even
don't have the InitializeComponent Function then...

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Stephen Davies - 25 Feb 2005 01:53 GMT
For the record so other don't need to waste their time....

I obtained KB822759 from MS applied the HotFix and didn't make an ounce of
difference, if anything it happened more frequently.

> >I am not directly inserting code into this block, I have a component that
> >creates properties on the page which can be modified. These properties  
[quoted text clipped - 21 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Gary Chang[MSFT] - 25 Feb 2005 03:30 GMT
Hi Stephen,

>I obtained KB822759 from MS applied the HotFix and didn't make an ounce
>of difference, if anything it happened more frequently.

I am regreted that Hotfix could not be applied to your case, it may be
designed only for the general scenario which that Knownledge Base atricle
is covered.

In this situation, if you concider that problem is really critical to your
work, I suggest  you contact our Product Support
Services to create a case for the problem directly. And if the problem is
confirmed by Microsoft PSS as a product
issue, PSS won't charge money. Every MSDN subscriber has two free support
incidents. You could use one of them to contact Microsoft PSS. So you don't
need to pay money yet. Surely if the issue is a product issue, you still
have two free support incidents.

For a complete list of Microsoft Product Support Services phone numbers and
information about support costs,
visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;[LN];CNTACTMS

If you don't want to contact Microsoft PSS, you could submit product
feedback on
http://register.microsoft.com/mswish/suggestion.asp?&SD=GN&LN=EN-US&g....

However, I suggest you contact PSS since there would be a support
professional working with you specially on it.

If there is anything unclear, please feel free to post here. We are glad to
be of assistance.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

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.