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

<CustomAction


Id=toolPaneWebpart


Description=Toolpane Webpart


Title=ToolPane Web part Action


GroupId=SiteActions


Location=Microsoft.SharePoint.StandardMenu


ImageUrl=”/_layouts/images/settingsIcon.png”


Sequence=10001>

<UrlAction
Url=_layouts/WebpartConfiguration/MyPage.aspx />

</CustomAction>

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.

Advertisements