ASP.NET 4.0 Web User Control (ascx) Library???
Posted on 2010-11-17
I have a handful of different websites. These websites are different is every aspect except for 1 function. This function involves a form with about a dozen or so fields. This form also looks and operates exactly the same on each website.
Instead of having the html and code for these forms duplicated on every site, I would like to create a "Web User Control" library in Visual Studio 2010. Without really hacking some things up, I cannot find a simple way to do this. I can create a custom Server Control library but since these forms contain multiple other controls, html and functionality, it would be really tedious.
I found one example where you create an empty "Web Application" project and add your ascx files in there. You then reference the published dll. This would actually work except for the ascx files themselves have to be copied over into each referencing web project.
Does anyone have any ideas? I find it hard to believe that Microsoft would not have included this ability.