Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 on computer

If you ever try to deploy a sandboxed solution and run into Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 on computer, this only means that the Windows service running sandboxed solutions is not running on the server. Continue reading

4 Comments

Deploying a Page Layout as a SharePoint Feature

The objective of this article is to show how to create a content type, associate a page layout for it, and deploy everything as a feature in a sandboxed solution. Make sure that the site where you deploy this solution has SharePoint Server Publishing Infrastructure Feature activated at site collection level, and SharePoint Server Publishing feature activated at site level. Continue reading

Leave a comment

Programmatically read the content of a publishing page

This article will demonstrate how to programmatically read the content of a publishing page. You need to know that the field in the PublishingPage holding the content is PublishingPageContent and that the ListTemplateID of Pages Libraries is 850. Continue reading

Leave a comment

Guide to Content Deployment in SharePoint 2010

The purpose of this guide is to show how to create a content deployment job in SharePoint 2010.

Content deployment refers to the process of copying content from a source site collection to a destination site collection. These site collections should be in different web applications (or different farms). Continue reading

Leave a comment

“The security Validation for this page is invalid. Click back in your Web Browser, refresh the page and try your operation again.” error after installing SP1 and CU

You receive this error on SharePoint pages because few SharePoint controls (PeoplePicker, EntityEditor) lacks OnLoad event after installing Service Pack 1 and Cumulative Updates.

Until this error will be fixed by Microsoft you need to add a FormDigest control to the body of the page: Continue reading

1 Comment

Redirecting to Access Denied Page

If you want to follow the same behavior as SharePoint in your custom web parts, if the user does not meet the security criteria for the current page you should redirect to Access Denied Page.

In order to achieve that you can use HandleAccessDenied method of SPSecurity. Continue reading

Leave a comment

Uploading files to SharePoint libraries

Uploading files to a SharePoint library can be done using the Add method on the Files property of a SPWeb like this:

SPContext.Current.Web.Files.Add(documentLibrary.RootFolder.Url + "/" + fileUpload.FileName, contents);

In the example that follows we will build a webpart that uploads a file provided by the user to a SharePoint library. Please note that the SPList was not necessary, it is only used to validate that the document library exists. Continue reading

Leave a comment

Change or set email for SharePoint users

For servers where local users are used, there is no interface that would allow you to set a user email in SharePoint. On servers using Active Directory, for users who create their SharePoint accounts before their email account were created(and set in AD) a similar situation can be found. Continue reading

Leave a comment

Configure SharePoint to send email through Gmail

In this article we are going to configure SharePoint Server 2010 to send emails through your Gmail (or Google Apps) account. For this we are going to configure SMTP service on Windows 2008 to forward emails to Gmail servers which will send the actual emails.

To configure the SMPT server: Continue reading

10 Comments

Adding a Custom Action to SharePoint Personal Menu

In this example we are going to build a feature using Visual Studio 2010, which will add a new link(custom action) to the Personal Menu of SharePoint 2010.

Personal menu or Welcome Control (Welcome.ascx) is added on every page by this line in the master page: Continue reading

3 Comments
Page 1 of 3123