Coding Tips

As some of you already noticed: GotDotNet is now down and the code samples previously hosted there have been migrated to the MSDN code gallery. For your convenience here are links to all my code samples: SharePoint  Powershell Script to identify the patch baseline for SharePoint and language packsThis script retrieves the version information for […]

A couple of weeks ago I wrote an article which explains how to deal with memory pressure situations in MOSS/WSS. Roger Lamb has now created an article which discusses one of the issues – missing Dispose() or Close() for SPWeb, SPSite and PublishingWeb objects. When to dispose and when not to dispose can be confusing […]

When developing a public facing website using the publishing features of MOSS it might be required to emit a ROBOTS meta tag that prevents internet search engines from indexing specific pages. The standard RobotsMetaTag control included in WSS generates the following tag: <META NAME=”ROBOTS” CONTENT=”NOHTMLINDEX”> Unfortunatelly most search engines do not understand the NOHTMLINDEX content […]

Yesterday I received an interesting question: a customer had the need to import several hundred keywords and related best bets programmatically to a couple of site collections. And for sure he did not want to do this manually using the web UI. I found the following solution for this problem: SPSite spsite = new SPSite(“http://localhost:4007”); SearchContext searchContext = SearchContext.GetContext(spsite); Keywords keywords = new Keywords(searchContext, new Uri(“http://localhost:4007”)); // loop begin Keyword myKeyword = keywords.AllKeywords.Create(“myKeyword”, DateTime.Now); […]

As you convert your ASP.NET 1.x applications to the new ASP.NET 2.0 framework, you may encounter issues related to the changes introduced by the 2.0 framework. In this article, we will look at both the conversion process and some of the common issues you may encounter during a conversion: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/conversionissuesasp_net.asp