Web UserControl inheritance in VS 2005

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.
 
S

Scott Allen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top