Saturday, January 24, 2009

VisualStudio Add-In for templated/skinned Web Parts generation



A new VisualStudio Add-In was recently released on codeplex. The Add-In is used for Web Parts generation based on prepared ASCX controls/templates. We call those ASCX controls "skins" because you can create multiple ASCX controls for a single web part (those controls can have different layout, styles, etc) and choose a different "skin" during runtime.


How to use it


It's very simple to develop web parts using the Add-In and the process goes like this:


  • Create an ASCX control that defines layout of a web part

  • Create a new web parts project

  • Right click on ASCX control, choose "Generate Web Part"

  • Go to generated web part and add your custom code-behind logic

  • Deploy web part by choosing "Deploy" option for web parts project.

A step-by-step tutorial together with Add-In installation is avaialable on codeproject: http://www.codeproject.com/KB/sharepoint/webparts_generator_addin.aspx

No comments: