About



Erik Burger is a .NET Consultant at Antares Informatisering, an outsourcing company based in The Netherlands. He refuses to specialise in a single programming language as a matter of principle, believing that being multi-disciplinary makes him a better developer. He's a strong advocate of Pragmatic Programming and a newbie enthusiast in Ruby and Rails.

View Erik Burger's profile on LinkedIn


Microsoft Windows SharePoint Services 3.0: Application Development


Disclaimer



All opinions expressed in this blog are solely those of the author and not necessarily those of Antares. You may use all the information provided here but please understand that it is provided "AS IS" and comes with no warranty of any kind.


213

Archive for September, 2008



Recently I’ve been working a lot with the SharePoint standard templates. A client wanted us to build a Web Part that had the look and feel of a standard SharePoint Web Part and the easiest way to achieve that was using templates. Using these, we didn’t have to worry about custom fields, save buttons, validation [...]

In his excellent post on How SharePoint 2007 Renders Its Content Geoff McElhanon shows how to programmatically load SharePoint-based templates. The code he shows us is as follows:

1
2
3
4
5
6
7
// Initialize template container with our custom template
templateContainer = new TemplateContainer();
templateContainer.Template =
SPControlTemplateManager.GetTemplateByName(RenderingTemplateId);
 
// Add the container to the webpart control hierarchy
Controls.Add(templateContainer);

However, I ran into [...]