Prompt Users to Save Changes

Want to be able to prompt users if they have unsaved data and they close out the browser? Unfortunately, I’ve yet to find a cross browser solution but in Internet Explorer and Firefox the onbeforeunload event gives you just that ability. The event will fire when a user closes the browser or when a user navigates to a different URL. Simply have the function assigned to the event return the string you wish to display to the users.

window.onbeforeunload = function() {
    if(window.event.clientX < 0 || window.event.clientY < 0)
        return "You have unsaved changes. Are you sure you wish to leave this page?";

The above code is setup to only work on the browser or tab close button. Remove the if statement if you want it to work when a user navigates away from the page.

Browser List Form Editing

Want the ability to add web parts and edit a List’s Form pages in the browser? SharePoint comes with a built in feature that in my opinion isn’t advertised enough to developers. At the end of you List Form URL, simply add the query string toolpaneview=2. It will look like:


Where ListFormView.aspx is either AllItems.aspx, NewForm.aspx, DispForm.aspx, or EditForm.aspx using the default names.

Having Datasheet View Issues?

If you’re using Office 64-bit and you’re having issues with SharePoint’s datasheet view, this post is for you.

Our team recently upgraded the software on our equipment and Office 2010 64-bit was our chosen Office version. Soon after, people started asking why the datasheet view was no longer working.  It just so happens that SharePoint’s datasheet view doesn’t play nice with 64-bit client software.

Why? The datasheet view uses a 32-bit ActiveX control. Internet Explorer 64-bit disables the datasheet view and without a 32-bit Office install IE 32-bit will give the following error:

Don’t fret though. There will be no need to downgrade to a 32-bit version of Office. This problem can be fixed by installing the 2007 Office System Driver: Data Connectivity Components. Once the downloaded AccessDatabaseEngine.exe is installed, the datasheet functionality should work in both SharePoint 2007 and SharePoint 2010.