I have an ASP.NET Webforms app where I’d like to add some HTML as a user control (Mycontrol.ascx
) generated from another Webforms project. I’ve tried following the (rather old) articles Turning an ascx user control into a redistributable custom control and Embedded UserControls: Revisited but as they are both for Visual Studio 2005 (the first was updated for VS 2010), in 2022 the options doesn’t seem to be the same. What I want to do is get the dll file (App_Web_MyTestUC.ascx.cdcab7d2.dll
in the first article example) that I could reference in my main Webforms app and include the contained control, together with its code behind and the required libraries (jQuery, Bootstrap, etc).
Indeed, I could just add it as a controller inside my main Webforms app, but I plan to use it also in other projects, keeping it as self-contained as possible. Any ideas are welcome, even if I can achieve the control to be distributable using a different approach.