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

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

John Saunders

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
 
A

Arvind Khasibhatla

John

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

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

Top