Wednesday, August 23, 2006

Web control library project in Visual Studio 2005

Today I wanted to create a custom ASP.NET 2.0 control (not to be mistaken with Web user controls a.k.a. ASCX controls). For this reason, in Visual Studio 2003 I used to create a stand-alone Web control library which actually contains the new custom control (s). Because the whole Web project base is changed in Visual Studio 2005, you won't find a "Web Control Library" project in New Web Site dialogue. Finally I made it through! This project type is now located in Windows section - point to File | New | Project ... and choose this project as shown on the screenshot below:

And now you can start add your custom controls to the Visual Studio 2005 Toolbox by right-clicking on the specific tab. Then select "Choose items.." from the context menu. In the ".NET Framework Components" tab, locate the assembly file of your Web control library and choose the controls you want to use. And that's it ..

No comments: