Inheriting an User Control in Whibey , i.e., ASP.Net 2.0

  • Thread starter Thread starter Arvind
  • Start date Start date
A

Arvind

I am trying to inherit an User Control from one another User Control
in ASP.Net 2.0.

Since we have partial classes in ASP.Net 2.0, this restricts me when I
try to do the same. I am using the code chunk below to inherit.

public partial class DerivedUserControl_ascx : BaseUserControl_ascx

Where BaseUserControl_ascx is the base User Control and
DerivedUserControl_ascx is the derived User Control.

Let me know if there is any work around / or if I am not doing it
right.
 
Arvind said:
I am trying to inherit an User Control from one another User Control
in ASP.Net 2.0.

Since we have partial classes in ASP.Net 2.0, this restricts me when I
try to do the same. I am using the code chunk below to inherit.

public partial class DerivedUserControl_ascx : BaseUserControl_ascx

Where BaseUserControl_ascx is the base User Control and
DerivedUserControl_ascx is the derived User Control.

Let me know if there is any work around / or if I am not doing it
right.

You haven't said what problem you're seeing.

I tried this and saw an error saying that each partial class must derive
from the same base class. I solved this by adding
Inherits="BaseUserControl_ascx" to the <%@ Control %> directive.

John Saunders
 
John

Thanks a Ton for the reply.
I am still getting an error even when I do the suggested steps by you.
 
Back
Top