Visit our SharePoint Forum

SharePoint developer? Submit Yourself as Freelancer

Sunday, June 27, 2010

Creating Event receiver in SharePoint 2010

See the complete Post @ our website Creating Event receiver in SharePoint 2010

Lets look at an example of creating a simple Item adding event receiver for a custom list.

Steps are :
1. Open Visual Studio 2010 and create a new Project.

2. In project types select Event Receiver and give it a name..... Read More...

Saturday, June 26, 2010

Types of Event Receivers in SharePoint 2010

There are six types of events that you can create in sharepoint 2010. These are :

List Events -
Adding/ed a new list field.
Updating/ed a field.

List Item Events -
Adding/ed a new list item or document.
Document checking/ed in or out.
Adding/ed an attachment.
Deleting/ed an item or document.

List Email Events -
A list received an email.

Web Events -
Deleting/ed a site collection or site.
Creating/ed a new site collection or sub site.

Feature Events -
Feature activating/ed or deactivating/ed.

List Workflow Events -
A workflow is starting/ed, postponed, or completed.

For complete example see

Copy files from one sitecollection to other in sharepoint 2010

Copying files from one site collection to other can be done using Content deployment feature of SharePoint 2010. You can do this either manually or on a predetermined schedule.

Some Important things to Note :
1. Content deployment is a one-way process - Content is copied from a source site collection to a destination site collection.The content deployment feature does not support round-trip synchronization from source to destination and back again.

2. Creating new content or changing existing content on the destination site collection can cause content deployment jobs to fail.

3. You cannot deploy(copy) a site to the same content database as the source site - This is because all the GUIDs that are used to define sites, Web pages, lists, and items are transferred with the site when it is deployed to the destination. For this reason, you cannot deploy a site to the same content database as the source site.

4. The destination site collection must exist before you can deploy content to it, and it must be an empty site collection.You must not specify a template for the site collection. If a template is used to create the site collection, the content deployment job will fail.

5. Before you start any process, you must first configure the destination server for receiving incoming requests or to accept content deployment jobs. This can be done using Content deployment Settings Page.

6. Lastly, Content deployment paths and jobs are created and managed on the Manage Content Deployment Paths and Jobs page in Central Administration.

Now lets talk about the main components

Content deployment paths and jobs - There are two main components of content deployment.

1. The first is a content deployment path, which is a relationship between a source site collection and a destination site collection.
2. The second part is a content deployment job, which is associated with a path and is a collection of settings that are related to the schedule and scope that are followed in deploying that content.

In short, A job is associated with a path, and it defines the specific content that is to be deployed from the source to the destination and the schedule on which the deployment should occur. After you have created the content deployment path, you can specify jobs to run on that path.

The Overall Steps that you need to follow are :

1. Create a source site.
2. Create a new Web application.
3. Create a destination site collection.
4. Enable incoming content deployment jobs.
5. Create a content deployment path.
6. Create a content deployment job.
7. Deploy the source site.
8. Update the source site.
9. Deploy changes.
10. Check the destination site for changes.

See detail explanation of Steps @ Content Deployment Step-By-Step

Wednesday, June 16, 2010

Application Pages Vs Site Pages

Definition :
Application Pages : An application page is deployed once per Web server and cannot be customized on a site-by-site basis.

Site Page : These are pages that make up the site interface and are specific to one site or site collection.

Storage :

Application Pages : They stay in 12 hive folder structure, mostly under layouts folder and aare

used by all the sites and site collections for that server.

Site Pages : They mostly get stored in the content database of the site collection.


Code Behind :


Application Pages : They do support code behind and inline scripts.

Site Pages : They donot support code behinds. We can only add WebPart zones to the site pages.


Look and feel :

Application Pages : They do not inherit websites current master page. They will always inherit from application.master.

Site Pages : They inhertit the custom look and feel of the site.

Examples :

Application Pages : settings.aspx, accessdenied.aspx etc

Site Pages : default.aspx, Allitems.aspx etc.

Tuesday, June 15, 2010

Powershell Interview questions SharePoint 2010

Q. What is Windows Powershell ?

Ans. Windows PowerShell is a new Windows command-line shell designed especially for system administrators. In the SharePoint administration context, Windows PowerShell is another administration tool that supersedes the existing Stsadm.exe.


Q. How is Windows Powershell different from Stsadm ?

Ans. Unlike stsadm, which accept and return text, Windows PowerShell is built on the Microsoft .NET Framework and accepts and returns .NET Framework objects. In addition to that it also gives you access to the file system on the computer so that you can access registry,digital signature certificate etc..

Q. What are cmdlet's?

Ans. Windows PowerShell introduces the concept of a cmdlet which are simple build in commands, written in a .net language like C# or VB.

Q. Can you Create PowerShell scripts for deploying components in SharePoint ?

Ans. If you are creating a webpart with VS 2010 then you can deploy it using ctrl + f5. However, to activate the webpart feature you can write a powershell script (.ps1) and execute it after dpeloyment.


Q. Where is Powershell located in sharePoint ?

Ans. On the Start menu, click All Programs -> Click Microsoft SharePoint 2010 Products -> Click SharePoint 2010 Management Shell.


Q. If you need going to install a webpart or any custom solution in SharePoint 2010 using PowerShell What permissions do you need?

Ans. In order to use Windows PowerShell for SharePoint 2010 Products, a user must be a member of the SharePoint_Shell_Access role on the configuration and content database. In addition to this, the user must also be a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed. See Details
Permissions for Windows PowerShell - SPShellAdmin


Q. How to list all the commands in PowerShell ?

Ans. Get-Command * commands gets you all the Powershell commands. For more commands see Here

Related Post : SharePoint 2010 Interview Questions for administrators

SharePoint Programming