UserControl as a DLL made easy
To create controls in asp.net there are two options available.
- Custom Controls
- User Controls
User controls cannot be compiled into a dll and redistributed while a custom control can be compiled into a dll. But a custom control does not have separate files to hold your markup and code which user controls have.
If I can have separate files for markup and code in custom controls, its the best option for creating redistributable custom controls. This will make my design clean as I will achieve a clear separation of concern between my presentation (markup) and behavior (code).
Currently this option is not available in asp.net but there is a nice article to achieve this. The code is also clean and does not pass as a hack but a proper way to create custom controls.