Web UserControl inheritance in VS 2005

  • Thread starter Thread starter Yuan
  • Start date Start date
Y

Yuan

It seems that VS 2005 doesn't allow inheritance for web usercontrols. I
created two web UserControls, WebUserControl1 and WebUserControl2. I
replaced base class of WebUserControl2 to be WebUserControl1 (public
partial class WebUserControl2 : WebUserControl1). When compiled, got
error: "The type or namespace name 'WebUserControl1' could not be found
(are you missing a using directive or an assembly reference?)"

In VS 2003, such inheritance is allowed.
 
In VS 2003, such inheritance is allowed.

That's because the types inside code-behind files could see each
other.

In 2005 the partial classes in CodeFiles for user controls and web
forms don't see each other unless you explicitly use an @ Register
directive.
 
Back
Top