April, 2011

Dumping DataTable to debug window

Here’s one little method I use to write out debug information when investigating some new (legacy but new to me) system. Usually I remove this method later when I know how code works. It’s maybe not the best way to debug things but it works like charm in many situations.

ASP.NET MVC 3: Using controllers scaffolding

ASP.NET MVC 3 Tools Update introduces support for controllers scaffolding with views and data access code. Right now I am building one very simple web site for free tech events and as I am building it on ASP.NET MVC 3 I have good testing polygon right here. In this posting I will show you how controller scaffolding works and what is the end result.

ASP.NET MVC: Defining short URL-s for root level pages

Short URL-s are more and more important part of page usability as mobile internet is growing. Long URL-s are not convenient to type due to small keyboards and screens of mobile devices. Also short URL-s are easier to remember and using well chosen short URL-s your pages may also get better rankings in search engines […]

ASP.NET MVC 3: Intranet Application template

ASP.NET MVC 3 Tools Update introduced new project template called Intranet Application. The main difference between internet and intranet application templates is the way how users are authenticated. In this posting I will talk about Intranet Application template and compare it to Internet Application template. Also I will give you references to guides that help you configure your intranet application.

10 interactive SharePoint 2010 labs by Microsoft

Microsoft has published some simple and nice interactive labs under title Build a better app that help you to get started with SharePoint 2010 development on Visual Studio 2010. Each lab should take about 15 minutes of your valuable time.

Unable to locate the xml-definition for CType with SPContentTypeId

When deploying your SharePoint solution to your development or test server where solution has been deployed before you may find errors like these in SharePoint log:Unable to locate the xml-definition for CType with SPContentTypeId and Failed to find the content type schema for ct-0-0x010100 during template lookup.

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive

When IIS is not configured properly after creating SharePoint application and there are web parts or features that use session you may get the following error: Unexpected error occured: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make […]

Failed to get value of the "Approval Status" column from the "Moderation Status" field type control

When upgrading site from SharePoint 2007 to SharePoint 2010 or if somebody has tried to be extreme smart-ass you may get the following error when saving item or document to list where content approval is turned on: Failed to get value of the “Approval Status” column from the “Moderation Status” field type control. See details in log. Exception message: Input string was not in a correct format.

Cannot use SharePoint 2010 API from console application

Suppose you create new console application using Visual Studio 2010 and add reference to SharePoint 2010 main library. When you run application you get the following error: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Same error may […]