Where have my Create options gone?

August 11, 2010

When trying to add a list or a library to a SharePoint 2007 site my only options on the Create page are to create Web Pages.

I needed to turn on the Team Collaboration Lists feature first for the site and my Create options expand to include Libraries, custom lists etc.


Telerik RadGrid not using AJAX in SharePoint Application Page

October 15, 2009

I have a SharePoint application page (A page that resides in _layouts and inherits from Microsoft.SharePoint.WebControls.LayoutsPageBase) Where I have a Telerik RadGrid. I have Ajaxified the grid by using a Telerik RadAjaxManager however whenever I filter or page the grid it performs a full page postback rather than an ajax callback. 

I managed to get this working by following the instructions here:

It appears it is the UpdatePanel functionality of AJAX that doesn’t play out of the box with WSS:

Windows SharePoint Services JavaScript has a “form onSubmit wrapper” which is used to override the default form action. This work is put in place to ensure that certain types of URLs, which may contain double byte characters, will fully work across most postback and asynchronous callback scenarios. However, if your scenarios do not involve double byte character URLs, you may successful disable this workaround and gain the ability to use ASP.NET AJAX UpdatePanels.

 taken from http://blogs.msdn.com/sharepoint/archive/2007/03/02/integrating-asp-net-ajax-with-sharepoint.aspx

So the code I have added to my SharePoint Application Page is:

protected override void CreateChildControls()

private void EnsureUpdatePanelFixups()
     ScriptManager.RegisterStartupScript(this, typeof(XXXXYourApplicationPageClassXXXXX), “UpdatePanelFixup”, “_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;”, true);

Note: This works for Application Pages only. If you are building a WebPart and having the same issue then the fix for this is mentioned in the links below.

Other useful resources:

Add a New Security Role (Permission Level) in SharePoint 2007

May 26, 2009

1) From the Site Collection go into ‘Site Settings’.
2) Under ‘Users and Permissions’ go into ‘People and Groups’
3) On the side menu go into ‘Site Permissions’
4) From the Toolbar click ‘Settings’ > ‘Permissions Levels’

From here you can create and edit your ‘Permission Levels’ aka ‘Roles’.

Took me a while to find this. Hidden in the depths of one of SharePoint’s sub-sub-sub menus. The API uses the term ‘Role’ however elsewhere this is known as ‘Permission Level’.

Error opening master page in SharePoint Designer

February 26, 2009

I had recently updated a custom Master Page. When trying to open this Master Page in SharePoint Designer I received this error.

soap:ServerServer was unable to process request. —> The file http://server/sites/site/_catalogs/masterpage/xxxxx.master does not exist.

I could see the page in the list however I couldn’t open it. All other files appeared do be fine and would open normally.

Back in a web browser I tried manually checking out the Master Page from the Master Page Gallery, which worked fine. However when I tried to check the file back in again it errored.

There is no file with URL ‘_catalogs/masterpage/xxxxx.master’ in this Web. at Microsoft.SharePoint.Library.SPRequestInternalClass.CheckInFile(String bstrUrl, String bstrWebRelativeUrl, Int32 iCheckinType, String bstrCheckinComment, Boolean bIsMigrate, Int32 iEditorId)
at Microsoft.SharePoint.Library.SPRequest.CheckInFile(String bstrUrl, String bstrWebRelativeUrl, Int32 iCheckinType, String bstrCheckinComment, Boolean bIsMigrate, Int32 iEditorId)

In the end I had to manually re-upload my custom Master Page into the Master Page Gallery.

This has fixed the issue however I am still unclear as to why it failed in the first place.

Error trying to deploy a feature to SharePoint

December 1, 2008

Using VS2005 to deploy a solution that I have been been working on previously without issues.  One day it decided to play silly buggers.

“This solution contains two assemblies with the same name, or the SharePoint server already has an assembly with the specified name”

I went into the GAC and deleted all the assemblies related to my deployment.  Deployment still errored but with another error (assuming this is progress).

“The solution can not be deployed.  Directory associated with feature XXX in the solution is used by feature YYY installed in the farm. All features must have unique directories to avoid overwriting files”

I deleted my feature from \12\template\FEATURES and tried again (another error, but different this time).

“The feature name XXX already exists in SharePoint. You need to rename the feature before solution deployment can succeed”

To fix this you need to completely remove the feature from SharePoint.

go to the administration SharePoint site > Operations > Solution Managagement.  Then retract AND THEN uninstall the feature from the same screen.

Deploying then worked.  Unsure as to why this started to misbehave and if it happens again I’m just going to uninstall the feature straight away and try again.

programmatically add a My Link.

November 7, 2008

This is how you add a My Link (aka QuickLink) in code.

Add a Reference to Microsoft.Office.Server


Dim context As ServerContext = ServerContext.Current
Dim profilmanager As UserProfileManager = New UserProfileManager(context)
Dim profile As UserProfile = profilmanager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName)
Dim qlmanager As QuickLinkManager = New QuickLinkManager(profile)
Dim ql As QuickLink = qlmanager.Create(pTitle, pUrl, pQuickLinkGroupType, pGroup, pPrivacy)

Get SPItems for a SPFolder

September 3, 2008

I have SPItems in a various sub folders in a custom list.  I have the subfolder however there didn’t seem to be any easy way of getting the SPList items for this folder.  The best/only way I’ve found to do this is by using a SPQuery as demonstrated at winsmarts.com.

Dim query As New SPQuery
query.Folder = mySubFolder
Dim list As SPList = SPContext.Current.Web.Lists(mySubFolder.ParentListId)
Dim items As  SPListItemCollection = list.GetItems(query)