SharePoint 2010
Feature Stapling in SharePoint 2010 Part II
At this point Feature 1 is complete and we are ready to deploy to our sharepoint environment. You should have a solution explorer similar to this: After you deploy, you can verify that everything worked by doing the following. Navigate to Site Actions -> Site Settings -> Site Collection Administration -> Site [...]
Retrieving the current user in SharePoint 2010 object model
This is a really simple code snippet to obtain the current user using the SharePoint object model. using (SPWeb spweb = SPContext.Current.Web) { SPUser oUser = spweb.CurrentUser; string Username = oUser.LoginName; } SPUser represents a user in SharePoint services. A new object (oUser) is created from the spweb property, currentUser. We can now access various [...]
Free SharePoint Development Tools
Four free SharePoint development tools you should consider using are: CAML Builder from U2U (http://www.u2u.be/Res/Tools/CamlQueryBuilder.aspx): Build and test your CAML queries and paste into your code. CKS (Community Kit for SharePoint, Tools Edition) (http://cksdev.codeplex.com/ ): Makes the SharePoint development cycle tolerable (almost). Version 2 was released May 2011. ULS Viewer (http://archive.msdn.microsoft.com/ULSViewer ) In my opinion, [...]
Using Linq to SharePoint – SPLinq
SPlinq allows you to write strongly typed queries against lists. Here are some key points to note: SharePoint 2010 exposes list data through a REST service that you can consume in your projects. The WCF data service SharePoint exposes is ListData.svc. eg http://sp2010dev/_vti_bin/listdata.svc You will need the ADO.NET client runtime installed on your machine In [...]
Sharepoint: Cannot convert type ‘Microsoft.SharePoint.WebControls.ScriptLink’ to ‘System.Web.UI.IAttributeAccessor’
I recently ran into this error which working on a custom page. Sharepoint: Cannot convert type ‘Microsoft.SharePoint.WebControls.ScriptLink’ to ‘System.Web.UI.IAttributeAccessor’ Whenever you copy a master page from one site to another in SharePoint designer, it converts certain tags to script. The solution is to cut and paste your code into a new masterpage file. Source: http://www.hexanes.com/?p=448
Feature Stapling in SharePoint 2010 Part I
While working on an internal project recently, I was tasked to implement feature stapling which would enable us to load a custom master page to the My Site (specifically My Content) section. Before we jump into all the details I would like to define some terms just in case there are newbies (like me) who [...]
Site collection codes in Sharepoint 2010
SharePoint 2010 ships with many in built templates. As a developer, you might come across the need to reference these values somewhere down the line. I’ve provided a list of the codes below. These are also available here .Please note that the Global template value can also be used as just “GLOBAL” instead of “GLOBAL#0″. Example: <?xml [...]