Designer files rewrite custom control when markup changed.

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

asp.net 2.0

I recently converted a website project to a WAP. I the process I have
moved our composite controls into their own subfolder. I have removed
the Register directives from the individual pages to the web.config.

The problem is every time I check out a page from SS and change the
markup the partial page file is rewritten. All my custom user
controls are changed to type UserControl.

the file starts like this:
private MyCustomControl customControl1;

Changes to this:
private UserControl customControl1;

This causes compile errors because of custom properties and events.
The aspx file does not have any errors. It recognizes the user
controls. The custom tags show up in the intellisense.

How can I get it to stop rewritting the partial class with the wrong
types?
 
A good answer I got from another source.

just put the declarations in the codebehind file instead of the
designer file.
 
Back
Top