Why Copying Code Can Be Bad

So here is an annoying thing that I was helping a friend sort out.  They were getting an error message that had then stopped in their tracks for a day or so.  It was something like:

The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)

So the application was a asp.net 2.0 app but they were converting it from a 1.1 app.  They created the file then copied its contents from the 1.1 app.  Well a little google-ing found this article.

He just changed the 'CodeFile' to 'CodeBehind' and all was good.  Thank God for other people's mistakes.

Published Friday, November 09, 2007 4:10 PM by dotnetgeek
Powered by Community Server (Non-Commercial Edition), by Telligent Systems