At what level does the UserControl base class belong?

I have an asp.net usercontrol (ascx) that inherits from an abstract class (which inherits from UserControl). My project is in a three-tier architecture (DAL β†’ Bll β†’ UI / Views). There are currently no class files in the user interface layer (except code delays). On which layer should I add this abstract class?

Thank you very much.

+4
source share
2 answers

UserControl is part of your presentation, so it should be at your user interface / view level.

Think of it this way: if I reprogrammed it as a Windows Forms application, what layers would I save? It will be DAL and BLL, therefore, nothing special for asp.net should be in any of these layers, but vice versa: everything that is needed for asp.net should be in the UI / Views layer.

+6
source

Definitely a presentation layer. Ideally, you do not want any user interface (for example, the base class UserControl or something from System.Web.UI) in your business logic.

+2
source

All Articles