Alex Rivera | Logout

How (if at all) can you make an ASP.NET UserControl inherit from another UserControl?

Asked 2009-03-12T13:03:43.623
13

In Windows Forms it's easy to inherit one user control from another. The inherited control contains all the controls of the parent form, and you can add some more. Can the same be done with ASP.NET? I'm talking about the .ASCX type of user controls.

Edit
Report

1 Answer

14

The short answer is no it can't be easily done. There's no inheritance between user controls or webforms. You can create an inheritance hierarchy between the code behinds classes but the gui components aren't inherited.

answered 2009-03-12T13:16:02.830

Your Answer