With the integration of Visual Studio 2010 and SharePoint 2010, creating features are now much easier than with previous versions of either tool. To begin creating a feature to modify the Site Action menu, create a SharePoint 2010 empty project in Visual Studio 2010, making sure to chose a Farm solution rather than Sandbox. After the project has been created, you will see the below structure.

Now add a new module in the project, I am naming it “SiteActionMenue”

You will see following files added in the project

You can delete sample.txt file

Remove module section and replace with this site action script



Description=Toolpane Webpart

Title=ToolPane Web part Action





Url=_layouts/WebpartConfiguration/MyPage.aspx />


Note : We have specified a url to the page, we will add that page later.

Set default site for this application when creating the new project, otherwise you can set in projects properties, see the following screenshot

Save the project and press F5

Go to site action and you will see a context menu.

Now go to project and add a new content page.

Press add and this will add a page in the solution within appropriate folder

Now press F5

After clicking on site action menu you will be redirected to page you have created.

That’s it, how simple it was, let me know in case of any confusion.



In this article we will see the new concept called relationship which was highly anticipated in SharePoint 2010 and which was lacking in MOSS 2007.

After a wait now it’s finally here with SP 2010. We can define the delete constraint over the lists. When we have a lookup column in child list pointing to a parent list and if we have defined the cascading delete constraint then we can allow deleting all child records when parent record is deleted or we can restrict deleting parent record when child record exists. This is the same behavior that we have in SQL Server delete constraint.

So let’s go and open our Employee Leave lists that we created for our earlier posts. If you have not gone through it, I would recommend you go through it to understand more concepts of SP 2010.

Go to list settings – Click on Employee ID lookup field which is pointing to Employee parent list’s Employee ID field and scroll down to find this.

Do remember that to enforce the constraint on field, that field must be indexed. If it’s not, SharePoint will prompt you and index it for you.

Here we have put in a restriction on delete that means if we go and try deleting record from Employee List; it should not allow us to do so. So let’s try that out.

Go to Employee List, and delete any existing record that has lookup item exist in Employee Leave list and see what you get.

f you have defined two lists which have lookup reference to the parent list and if one list allows cascading delete and one do not, then parent list item will not be deleted because one list does not allow cascading delete. And this is what it should be.

When every list allows cascading delete then when you delete item from the parent list, it delete all related records from all related lists which have lookup field referenced to the parent list field. It also actually shows you the names of all lists which have the association while you are deleting the parent item. Check this out.

It is showing Employee Projects as well as Employee Leave, click on Ok to delete all related items in child lists as well as parent item.

Employee ID =1 removed

Related record from the leave list also removed

I hope now you will have a fair idea about the new relationship behavior functionality in SharePoint 2010


We will see one of the new concepts from SharePoint 2010 which is related lists. We already have employee list with us. All we need to do is create two more lists. I am creating two lists just to show you an example. We can have as many lists we want.

Create Employee Leave list and go to list settings and create one column which is Empoyee ID and take it as a look up column from Employee list and field Employee ID. One new feature here is when you define lookup column. Now we have the ability to fetch fields from that item and display it in the list as well.

So now when you enter the data in the Employee Leaves and select Employee ID from lookup drop down, you get something like this

So what happens is, here you would be able to see parent item details as well along with the actual list data.

Now go ahead and create one more list and call it an Employee Projects. Do the same thing, add columns and add EmployeeID column lookup to the Employee list and Employee Field.

Now add some data to this list. So what we have now is three list which are connected from Employee ID look up fields. Empoyee is the main list and then we have two lists with lookup to the Employee list employeeID field.

Open the List settings page of Employee List, create one view and call it a RelatedList view. Open the related list view and click on Site actions -Edit Page.

Go to options tab and then see we have new option called related list

If I select first employee it shows realted entries in project and leave lists.

If I select 2nd employee it shows records related to that entry.


Earlier in MOSS 2007, it was not possible to validate the value of the field at the time of entering or updating the value in the list items. We could do that, but we had to rely on handlers or custom fields.

Yes, still for some requirement we have to go with these options, but at least for the basic and indeed useful now we have something called column validation in SharePoint 2010.

I have created one Employees List ready in my SharePoint site and I have added three columns to it. It has Joining Date, Leaving Date and weight.

We will see two things here. First is the field level validation and the other is item level validation. You can treat this as a custom field validation and event handler validation.

Go to list setting and then click on the weight and now we can see one new section which says column validation. So go ahead and add below condition and type in the user message that you would like to see when condition becomes false.

Click on ok.

Now being on the list settings page, you can see one more new option which is validation settings. Click on it to open a page.

In validation settings, you can actually compare one field with the other field from the list and then show a message to the user. Here in our list for example, we have two date fields and of course joining date cannot be greater than Leaving date. Hence we need to validate these two date fields.

Hence we put this formula inside it.

Now go to the list and add new item and enter weight less than 50 and enter joining date greater than leaving date and see validation triggering.

Now this is a cool new feature of SP 2010, isn’t it?

But yes do remember that we can have only one list validation, which is unfortunate i think and column validations are evaluated first and then list validation.

Another new change in SharePoint 2010 is that when you create a new/edit/disp form it is displayed in a popup.

If you want the forms to open normally while creating, editing or displaying item, then go to list settings – advanced settings – dialogs and then select NO.

Click ok and create a new item now

Quite simple it is


I have started exploring SharePoint 2010 and today I have found one of the new features of this version. In this version we can set a column with a unique value in a list. Like I have a column “title” in the list and I want to have this column unique values. Although this can be done in SharePoint 2007 but for this you need to create a custom feature and need to attach some event handlers to the list and then you have to code to check the uniqueness but in this version it is already developed, let see how can we implement a list having unique values.

Create a new List and I am naming it “ListwithUniqueValues”.

In this list there is a built-in column “Title”, so I am not creating a new column for unique values but you can create a new column by going list settings and clicking on create a new column. Click on the title column and check enforce unique values Save the column and go to the list and all some values. I am adding “First” in title field for first entry. Now when I try to add another entry with “first” title it shows error. When I type “second” it works fine. It was quite simple, let me know in case of any confusion.


today i am going to setup Form based authentication, i have already completed that but now i will do this in IIS 7.5, so i will be skipping some steps. if you want to have a look at that, please https://shafaqat309.wordpress.com/2011/01/15/forms-authenticationwssmoss/

first of all create new database using aspnet_regiis tool

i am naming it “FBA”

open IIS and open the settings if Central Administration Web Application.

first of all set the connection string

now move to “Providers”  select “.Net Users” from the feature drop-down, name it “FBAUserProvider” and select your preferred settings.

once done then select  “.Net Roles” from the feature drop-down and configure the role provider,  i am naming it “FBARoleProvider”

that’ s it for the central admin application now move to new web application that u have created for Forms Based Authentication if u have not created yet then create it now.

create new connection string, user provider and role provider and this time set them as default and enable them.

now move to central admin site and select the application and move to Authentication Providers.

select form based authentication and provide the name of membership  and role provider and save settings.

now create a new user using IIS and add this user to site collection administrator.

now enable form authentication for new web application using IIS

now open new web application

click at the top right corner then u will be navigated to the login page

i will come with another page on how to customize the login page and add own custom application pages. Leave ur comments.