Coding Tips

Often it is necessary to ensure that updates to files on the server get populated to the client asap. Especially when it comes to dependencies to custom javascript of CSS files and server controls. SharePoint itself does this by adding a query string to some of its vital Javascript files. E.g.: /_layouts/1033/core.js?rev=PQia%2B0EyudqxiQyTfOSR%2Fw%3D%3D Whenever the core.js […]

Recently I came across another very interesting coding pattern which is very similar to the interesting SPSite leak I showed a couple of days ago. public void workOnArea(Area area){      if (area.Web != null)      {            string url = area.Web.Url;            area.Web.Dispose();      }} On a first look the code look ok, right? Ok, no try/catch blog […]

[via Paul Andrew’s blog]  SPDisposeCheck is a tool to help SharePoint Developers follow memory management best practices when using the SharePoint API with IDisposable objects including SPSite and SPWeb. This tool is not supported by Microsoft and is recommended to be used on Developer workstations and not on production SharePoint Server installations. It was released […]

Today I came across a very interesting coding pattern: public void enumSiteCollection(SPSiteCollection spSites, int min, int max) {     for (int i = min; i<max; i++)     {         if (spSites[i] != null)         {            DoSomething(spSites[i]);             spSites[i].Dispose();         }     } } On a first look the code look ok, right? Ok, no try/catch blog […]

Lots of articles have been written in the past which outline the importance of proper dispose for SharePoint SPSite and SPWeb objects in custom code. One important topic which hasn’t been discussed very often till now is how to avoid missing a dispose in case that an error occurs during execution of custom code. Roger […]

I have discussed problems with missing dispose for SPWeb and SPSite objects earlier on my blog (e.g. here and here) and Roger has provided a guidance for specific coding patterns which can cause problems such problems. In the last couple of month I have been involved in a project driven by Roger Lamb to create […] now hosts a brand-new learning track: SharePoint for Developers, Part I Ramp Up is a free, online, community-based program that can help users save time in learning Microsoft technology. The easy-to-access content (provided by subject-matter gurus) is specifically tailored to the Ramp Up program, and offered in a variety of forms (whitepaper, v-lab, codecast […]

As a follow up to my article series about the content deployment and migration API here are some tips on how you can “fine-tune” the out of the box content deployment jobs. This will include information about how adjust settings in Content Deployment Paths and Jobs and also about how to adjust content deployment global […]

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 […]