.NET

Custom code with SharePoint Online and Windows Azure

When I first heard about SharePoint Online at the PDC 2008 I was a bit disappointed that you could not use custom code but had to rely on the built-in functionality and the things you could do with SharePoint Designer (which is quite powerful anyway, especially with jQuery). To read more about SharePoint online, head over to Tobias Zimmergrens blog. But with some clever techniques you can take advantage of the Windows Azure Hosted Services and create your custom code.

.NET

Web Part Properties - part 1 - introduction

I thought that I should kick off this new year with a series of posts on how to make your SharePoint Web Parts editable and how to enhance that out-of-the-box Web Part property editing combined with some tips and tricks. This first post may be to most of you SharePoint developers somewhat basic, but I have chosen to start from scratch here. Many of this first post topics are repeatedly asked in the MSDN development forums.

.NET

How to sort XML without XSL in the .NET Framework

I have several times needed a way to sort XML, retrieved from a file or a web service, inline without invoking XSL transformations, which is the most common way to do it as I have seen. The .NET Framework contains the System.Xml.XPath namespace and is available from the .NET Framework 1.1 and up. This namespace contains a number of classes which can improve the performance of your .NET classes when working with XML.

.NET

Smooth upgrade of .NET XSL transformations from 1.1 to 2.0 or higher

When .NET 2.0 was introduced, quite a long time ago, the whole System.Xml namespace was re-written, due to the poor performance of the System.Xml implementation. Despite the fact that the CLR 2.0 has been around for a few years there are still implementations using CLR 1.x and especially the XSL transformation bits, since that part is completely re-written and marked as obsolete. But note that they are only being marked as obsolete!

.NET

Using the new ListView control in SharePoint

The Microsoft .NET Framework 3.5 contains a great new ASP.NET control called ListView. When using the ListView control you have much more control over how the output HTML will look like, which I think still is the main problem with the ASP.NET controls. To learn more about the ListView control, head over to Mustafa Basguns blog and read his excellent articles on the control. The ListView control is great when working with SharePoint (WSS3 and/or MOSS 2007) custom pages, since designing SharePoint pages which adapts into the current administration or takes advantage of all the CSS styles demands you to have pretty good control of your HTML.

.NET

Dissecting XPS, part 6 - reading XPS files programatically

The sixth part of the Dissecting XPS series is here and this time we will, finally, look at some code for reading XML Paper Specification [1], XPS, files. I will in the following sample not use the Microsoft.NET 3.0 Framework, which has built-in functionality for reading and writing XPS files [2]. Instead I will do it using .NET 2.0 (you can try it in .NET 1.1 if you like) and an excellent ZIP library called #ziplib [3].

.NET

A Cheat sheet of Cheat sheets

Here is a list of cheat sheets for the Windows and .NET platform that I frequently use and I think are of great interest. Visual Studio 2005 Keyboard Shortcut References Visual C# 2005 - PDF grayscale | PDF color Visual C++ 2005 - PDF grayscale | PDF color Visual Basic 2005 - PDF grayscale | PDF color SharePoint and Office stuff CSS Reference Chart for SharePoint 2007 (Microsoft Office SharePoint Server 2007 and Windows SharePoint Services v3) CSS Reference Chart for SharePoint 2003 New Office 2007 User Interface - Word | PDF Web and ASP.

.NET

Updated: Even better encapsulation of getting a value from XmlNode

I previously suggested a better method for getting attributes for an System.Xml.XmlNode in a response to an post by Marcus. Craig Nicholson highlighted in a comment that the code i provided can be even further optimized. private static string GetAttribute(XmlNode node, string name) { XmlElement elm = node as XmlElement; return (elm == null) ? string.Empty : elm.GetAttribute(name); } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .

.NET

Preventing comment spam using LinkSleeve

I have a lot of problem with comment spam on the blog as well as spamming on the trackbacks and the problem is spread widely over the blogging world. A lot of you turn off comments or have registration or other methods to get rid of the comment spamming. LinkSleeve (SLV - Spam Link Verification) is a link spam solution that checks a text for well-known URL’s in a text and tells if it contains any known spam addresses.

.NET

Even better encapsulation of getting a value from XmlNode

Marcus writes in his blog how he often ends up with a method that reads an attribute from an XmlNode object. He has optimized his method so that the exception handling will be minimal, since that is pretty expensive. This is a pretty common scenario for me and I have an even better solution, that does’nt involve exception handling at all. private static string GetAttribute(XmlNode node, string name) { XmlElement elm = node as XmlElement; if (elm == null) { return ""; } return elm.

.NET

XML Notepad 2006 - what's the fuzz about?

There seems to be some kind of software release frenzy at Redmond right now. Microsoft are spitting out application after application and I don’t mean the two huge ones; MIcrosoft Windows Vista and Microsoft Office (Server) System. Applications, small and big, like Internet Explorer 7, Windows Live Writer, XNA Game Studios, different Microsoft Live applications, Windows Desktop Search and now XML Notepad 2006 are dropping out from the software factory. It’s fun, but it takes me so much time reading and catching up on the releases.

Microsoft Expression

First Impression of Microsoft Expression Web Designer

So, after some installation trouble the Microsoft Expression Web Designer was installed, read more about it in the EWD Discussion group.The Expression Web Designer is for me a new and improved FrontPage more focused on the layout. I made some initial pages/sites and I feel that it works pretty smoothly to work with. The target group for this product is purely front-end/html programmers.The EWD will complement the Visual Studio development but the lack of source control integration is not just irritating - it’s a “application breaker”.

.NET

Updated ComPlusWrapper class

Here is an updated version of the ComPlusWrapper that I previously published, this one contains a Hashtable for caching the ProgId/Types as well as a method for invoking methods.Please post any comments to the code or any improvments to the class. public class ComPlusWrapper : IDisposable { private static volatile Hashtable s_types = new Hashtable();private static volatile Object s_lock = new Object();private object _ComPlusObject; private Type _type;private bool _IsDisposed = false;