Custom Web Control vs. User Control? what's your choice ?

Recently, I needed to do a small update on a couple of sites, and, for my surprise, I realised that the control used to do the "page header hard work", was the User Control instead of the Custom Web Control.

OK, Certainly, the developer was under pressure and the easiest (and also quicker) way to solve the problem was writing the control this way. The couple fo sites were in SourceSafe too, so when I started to get local copys of the projects many versions of the "page header control" were created by SourceSafe. Just for your information there were "WebControl1",  "WebControl2", "WebControl3", "WebControl4", "WebControl5" and "WebControl6" folders created.

On the other side, because of cross domain (I guess), the ASCX file needed to be on all the projects.

In my opinion, controls that will be used for more the one project, should be Custom Web Controls instead of User Controls, but, that wasn't the point on that job. So, I rewrote the control as a custom one, and from now on all the developers will use just the reference to that assembly and add the control on the toolbox group they want. No more ASCX files needed to be copied over the projects and folders and more folders being created by SourceSafe.

See you and I hope that from now on, I'll post articles more often.

Chilá!@!

2 Comments

Comments have been disabled for this content.