Category Archives: General

SharePoint 2010 – Content Types and Site Columns in .wsp’s

Remember having to create features that deploy custom content types in MOSS 2007? How painful it was? How you just really didn’t want to do it?

In SharePoint 2010, it is super easy. Just see here.

SharePoint CSS: Moving webparts

This issue has been bugging me for months. On several sites that I’ve branded, I’ve add a DOCTYPE to the masterpage that indicates to the browser to render the pages in standards mode. An unfortunate side effect of this occurs when you try to move webparts on a page: the little bar that pops up that you drag to a new webpart zone is way off. Like 200px off. Fortunately, I found a solution from this website. (which actually deals with a different issue, but it works for this too)

Just put this code in your masterpage or external .js file. Make sure the code or link reference is the last thing in the tag.

function MSOLayout_GetRealOffset(StartingObject, OffsetType, EndParent)
	var realValue=0;
	if (!EndParent) EndParent=document.body;
	for (var currentObject=StartingObject; currentObject && currentObject !=EndParent
         && currentObject != document.body; currentObject=currentObject.offsetParent)
		var offset = eval('currentObject.offset'+OffsetType);
		if (offset) realValue+=offset;
	return realValue;

Virtual PC: Tab/Escape not working

Today, all of the sudden the tab and escape keys stopped working in Virtual PC.  Had never happened before.  I reinstalled VM Additions, restarted the VM, nothing worked.  I then found the solution in a form post:

If you are running into this issue on Vista and Windows 7 you can get the TAB key back by creating a software allow policy. Go to administrative tools, local security policy, Software Restriction Policies, Additional Rules. Create a new rule for %appdata%microsoftvritual pcvpckeyboard.dll and set it to Unrestricted. Restart Virtual PC.   If the variable doesn’t work, try using an explicit path i.e. c:usersusernameappdataroamingmicrosoftvirtualpcvpckeyboard.dll”

Did that and it started working.  Note in the post that this applies to Vista and Windows 7 only.  I’m running Windows 7 x64.

Windows 7/Server 2008 R2 Boot to VHD

Found this great tutorial on creating bootable, sysprep’d VHD’s on the fly here.

I plan on trying this out later this week and posting my findings.

Big javascript post

All of this javascript goodness became useful while I was using jquery to call Sharepoint web services, specifically after I wrapped all of the functionality into a class.

1.  Context – this issue arose while using jquery’s .ajax() method as so:

            url: "../_vti_bin/lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: this.processResult,
            contentType: "text/xml; charset="utf-8""

I kept getting an error saying it couldn’t find the processResult() function. Turns out the “this” keyword wasn’t returning the context of the class. Instead, it was returning the context of the ajax() function call. After searching the intrawebs, I came accross this article. So, by adding the code and changing “this.processResult” to “$.context(this).callback(‘processResult’)” the problem was solved.

1A. Context and Recursion – this issue occurred while using a recursive function to write out a menu with child elements. Once again, this worked fine until I put everything into a class. However, once I did that, I started getting some weird issues with my for loop. The counter would increment twice while the recursive call was made. I wasn’t able to figure this one out, so I just unrolled the function.

2. Array sorting (mostly for my benefit) – a cool way to sort an xml array in descending order:

   this.sortRows = function(a, b){
        return ($(a).attr("columnName") - $(b).attr("columnName"))

Then call the function like this:


Ensure Infopath Forms open in browser

Here’s a good way to ensure all of your Infopath Forms open in a browser, no matter where they’re linked from:

Vista/Server 2008 Not Shutting Down

This is mostly for my purposes…

If you’re having trouble with Vista/Server 2008 not shutting down, try running:

fsutil resource setautoreset true C:

and then restarting your computer.  This resets the NTFS transaction logs on your C: drive which apparently can become corrupted.  As a bonus, I think it sped up start-up as well…

CSS Framework

Just came across this today:

Looks like a good starting point for anyone developing a new website.  I know from past experience that fighting with page layouts consumed a good chunk of time when I developed a website.  So, anything that could save me time would be very useful.

Looks like it even works for Sharepoint!

Outlook 2007 Free/Busy Issues

Came across an interesting issue that I thought I would pass along.  For the longest time I couldn’t see any Free/Busy information when I used the Outlook client to connect to Exchange.  When I used webmail, the information was there.

I finally figured out why:

After I added the key, the info is available.  Unbelievable.

New Sharepoint Book

Here’s a new Sharepoint book that my manager Sean McDonough and John Ferringer co-wrote:

SharePoint 2007 Disaster Recovery Guide

Book Description:

Microsoft’s SharePoint technology gives organizations access to a wide range of tools and functionality designed to encourage collaboration, manage documents, discover shared knowledge, and much more. As the use of these resources through SharePoint grows, so does an organization’s dependency upon the availability and reliability of its SharePoint infrastructure. Disaster recovery is not a new concept in the realm of information technology nor is it unique to SharePoint, but as with any specialized technical platform, disaster recovery planning for SharePoint presents unique challenges and approaches. The problem is that SharePoint disaster recovery is not as simple as backing up your discs or load balancing your servers. It requires specialized activities to save data for recovery and to subsequently properly recover that same data. SharePoint professionals need a cohesive and comprehensive resource that guides them through the steps of planning, implementing, and testing the right disaster recovery plan for their situation. The “SharePoint 2007 Disaster Recovery Guide” provides such a resource. It provides a unique guidebook to all the necessary best practices, procedures, and tools for disaster recovery in SharePoint, such as how to plan for disaster recovery in SharePoint, and how to setup SharePoint, SQL Server, operating system, and file system backups step-by-step through SQL Server or STSADM.exe. The negative and positive aspects of every solution are detailed so that users can pick the disaster recovery plan that’s right for them. This is an essential guide for any IT professional tasked with protecting their organization’s valuable SharePoint data.

Amazon Link

Switch to our mobile site