In my current system the menu is generated via a CustomControl code, which is shared by others project to generate menu as well. Currently i need to add some functionality to it so that when the scree size shrunk it would be reworked into a design more suited for smaller screen i.e. mobile.
I have worked out how should i make the changes work, however, i found that having html code generated via CustomControl might not be that easy to maintain. For one, the person who’s going to change it would need to know what it is doing and need to have the knowledge on the lifecycle of it as well.
I’m thinking whether i should refactor the CustomControl into a UserControl, but having read the different between them, it seems that CustomControl is actually more suited since this menu system is being shared across multiple application.
So what do you guys think? Is having it generated by CustomControl a bad practice (since it makes it more difficult to maintain)? If i use UserControl is that a way to cut down the code duplication for it?
Thanks
If the control is tied to the application, I’d opt for
UserControl, since as you stated, it’s easier to visualize, edit, and maintain.if you need to use it across several projects, or it needs to be highly programmable/customizable, then I’d opt for a server control.
I wouldn’t consider one or the other bad practice. I would choose based on which is simplest to implement and maintain.