Geeks With Blogs
Madhawa Learns To Blog : C#, Java .net, c#, java,sql, OOAD and more mad memory dumps... MOSS
What You Need To Know About AllowUnsafeUpdates

Very good insight on using "AllowUnsafeUpdates" in SharePoint object model.

Posted On Friday, January 11, 2013 10:18 AM

Enable Content Approval on a Custom SharePoint list using the list definition
Yesterday I realized that non of my custom lists enforce content approval by default. That really worried me as 90% of the data we display in the web site which I'm working on are coming from custom lists. Enabling this manually is a piece of cake but I wanted to include this in the list definition. After some research and testing I found out that there are 2 places you have to configure. You have to set ModeratedList="TRUE" for List element and EnableModeration="True" for ListTemplate element in ......

Posted On Wednesday, August 24, 2011 7:57 AM

GetUserListSchema(): Failed to get the list schema XML for feature
These days I'm working on a CMS solution and I had all my list definitions and list instances in one feature, so everything was working fine. But its not ideal as each time I change the list definitions I have to de-activate and re-activate the whole feature. And each time I do that the default data I have defined in list definitions are duplicated. So I created another feature for list instances but its giving the following error when trying to activate. "GetUserListSchema(): Failed to get the list ......

Posted On Wednesday, June 15, 2011 12:15 PM

Add Permission Level to a Sharepoint user group collection
/// <summary> /// Add Permission Level to a Sharepoint user group collection /// </summary> /// <param name="spWeb">The sp web.</param> /// <param name="permissionName">Name of the permission.</param> /// <param name="groupCollection">The group collection.</param> public static void AddPermissionsToGroupCollec... spWeb, string permissionName, string[] groupCollection) { SPSecurity.RunWithElevatedP... { try { //Allow updating of ......

Posted On Monday, August 17, 2009 11:06 PM

Get value collection of a SharePoint Choice Field
public static List<string> GetChoiceFieldValues(string listName,string fieldName, string siteCollection, string webSite) { List<string> fieldList; SPSite spSite = null; SPWeb spWeb = null; try { if (siteCollection != null) spSite = new SPSite(siteCollection); else spSite = SPContext.Current.Site; if (webSite != null) spWeb = spSite.OpenWeb(webSite); else spWeb = spSite.OpenWeb(); SPList spList = spWeb.Lists[listName]; SPFieldChoice field = (SPFieldChoice)spList.Field... fieldList ......

Posted On Saturday, August 1, 2009 4:01 AM

Add a user programmatically to a User Group in SharePoint
/// <summary> /// Add a user to a Sharepoint group /// </summary> /// <param name="userLoginName">Login name of the user to add</param> /// <param name="userGroupName">Group name to add</param> private void AddUserToAGroup(string userLoginName, string userGroupName) { //Executes this method with Full Control rights even if the user does not otherwise have Full Control SPSecurity.RunWithElevatedP... { //Don't use context to create the spSite object ......

Posted On Tuesday, November 18, 2008 6:47 AM

STSDEV: Simple Tools for SharePoint 2007 Development, With different project name support
STSDEV is a simple tool for SharePoint developers. It helps you to create SharePoint projects (with solutions precisely) and deploy templates and components into the SharePoint 2007 platform. This tool creates project and solution in same name and in the same folder. We all know we never put the solution and project files in the same folder and never use same name for the solution and the project. Unfortunately we didn’t find a way of changing those and use the tool ......

Posted On Tuesday, August 26, 2008 10:39 AM

Copyright © Madhawa Karunaratne | Powered by: | Join free