Tuesday, March 13, 2007

developing WSS web parts in .NET 2.0

I'm now attending a session on the development of web parts in .NET 2.0. One negative to this task is that there's no designer surface, unless most of the .NET development tasks that I've performed. Blake Baker of CTLT, the first presenter, noted the advantages of performing development on the machine running WSS. The preferred namedspace for development is:
System.Web.UI.WebControls.WebParts.WebPart.

Right now, he's typing the code in Visual Studio using C#, with all of the code contained in a Class1.cs file. You perform the development inside of the server control. The control is designated as a safe control in .NET, then the control can bve viewed and edited in SharePoint's Web Part Gallery.

As an alternative to the code-based approach, he demonstrated the use of Web User Control, enabling work to be done using a designer surface. A usercontrols folder is added to the SharePoint folder hierarchy, and a user control can be copied to the folder to deploy it. Once this is done, the Add User Control feature must be used in SharePoint. The control info is then successfully displayed. This second strategy requires the use of the .NET SmartPart.

No comments: