>Seems like a relatively common problem. I have found many postings on
>exactly the problem but no answers.
> 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.