Posts

Showing posts from February, 2012

Hide a SharePoint list field based on user group using JQuery Webservice in 2010

A field in a SharePoint list form like NewForm.aspx or EditForm.aspx can be easily hidden by using the following Jquery statements. Assume that we have an input field named Feedback var feedbackField = $("input[title=Feedback]"); feedbackField.parent().parent().parent().hide();    But what if we want to hide the field for a particular SharePoint user group only. Let's say we have a user group named "Test Group" and we don't want to show the Feedback field to the users of this group. In order to achieve this we need to know whether the current logged in user belongs to the "Test Group" or not.This can be done by using   SPServices , a Jquery library for SharePoint web services. Grab the latest version of SPServices Jquery library from codeple x and Jquery from here . Once you have both .js files, upload them to a SharePoint document library. In my case I created a folder named JS inside Shared Documents Document library and uploaded both files...

How to create custom properties for visual webpart in SharePoint 2010

Image
In this article we will be seeing how to create custom properties for visual webpart in SharePoint 2010. Steps Involved: Open Visual Studio 2010. Create an "Empty SharePoint Project". Right click on the solution and click on Add => New Item. Select "Visual Web Part" template from SharePoint 2010 installed templates. Entire solution looks like the following   Replace CustomPropertiesVisualWP.cs file with the following code. using System; using System.ComponentModel; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; namespace CustomProperties.CustomPropertiesVisualWP {     [ ToolboxItemAttribute ( false )]     public class CustomPropertiesVisualWP : WebPart     {         public static string _value;       ...

SharePoint 2010 : Migrate User Controls to SharePoint 2010

Image
SharePoint Overview SharePoint is a very robust and scalable Content Management and Collaboration Platform from Microsoft. It extends over the existing ASP.NET framework and provides a whole set of out of the box features for setting up well integrated websites in minutes, without any development knowledge. The soul of SharePoint is Web Parts and all users interact with the site through web parts placed into pages. There are numerous out of the box web parts that let users access the site and its features. However, at times the out of the box functionality is not sufficient or is not customizable to the degree that one requires. Thus it becomes inevitable to build our own web parts that provide the necessary functionality. A web part is a reusable component that can be added into any SharePoint page in any site and can be configured to perform its functions through its properties. Example of web parts could be a Slide Show Web part that displays a slide show of images in an Imag...

SharePoint 2010: How to Migrate a SharePoint 2007 Site to SharePoint 2010 Using Database Attach

Image
Change is never easy! Whether it's going to college, getting married, or just getting the new, cool haircut you've always wanted, there will be something that you'll miss not having (freedom of the single life, anyone?). Moving to SharePoint 2010 is no exception. Although upgrading is rewarding, with improvements in many areas, you will still need the precious content that exists in your current SharePoint 2007 environment. In this article, I'll demonstrate how to migrate a site to SharePoint 2010 using the database attach method . Challenge: How can I migrate just the site/site collection I want from SharePoint 2007 to SharePoint 2010? Moving the entire farm to SharePoint 2010 could take a lot of time, bordering on seeming like forever. Sometimes, however, we just want to get the contents of a specific site/site collection up and running on the new platform as soon as possible. Solutions: Using the database attach method, we can migrate a...

SharePoint 2010: Migrate a Single List to SharePoint 2010 from 2007

Image
Challenge: I recently needed to move a list from SharePoint 2007 to SharePoint 2010 .  I wanted the destination list to have the exact content as the source list including structure, list items, and attached files.  Since SharePoint does not have an STSADM.EXE command line tool to accomplish this, it needs to be done manually.  What are our options? Solution: After doing some research, I discovered that there are a few ways to accomplish this task.  You can migrate a single list from SharePoint 2007 to SharePoint 2010 using one of four methods: Migrate a single list from SharePoint 2007 to 2010 using a list template Migrate a single list from SharePoint 2007 to 2010 using an Access table Migrate a single list from SharePoint 2007 to 2010 using the detach database method Migrate a single list from SharePoint 2007 to 20110 using PowerShell I'll summarize and show how each of these methods works in this article. Method 1 - Migrate a single list from SharePoin...