views:

24

answers:

2

I have an asp.net usercontrol (ascx) that inherits from an abstract class (that inherits from a UserControl). My Project is in a 3-tier architecture (DAL -> Bll -> UI/Views). Currently there are no class files in the UI layer (other than the code-behinds). Which layer should I add this abstract class to?

Thanks so much.

+4  A: 

A UserControl is part of your presentation, so should be in your UI/Views layer.

Think of it this way: If I was re-implementing this as a Windows Forms application, which layers would I keep? It'd be the DAL and BLL, therefore nothing specific to asp.net should be in either of those layers and the converse is: anything specific to asp.net should be in the UI/Views layer.

Rob
+2  A: 

Definitely presentation layer. Ideally you don't want anything UI-dependant (such as the base UserControl class or anything from System.Web.UI) in your business logic.

David