Setting default landing page through code in sharepoint

Usually when i want to set the page as home page i visit the page URL and open the top navigation bar by clicking the Page option and select the option Make Homepage.
There is also another way to set set the page as home page visit the Site Settings, Site Welcome Page, browse to the destined location select the page and click ok to set it as defalt welcome page or landing page of your site collection in sharepoint.
I wanted to set is through code, via the visual solution, publish the solution activate the feature and you are good to go. In your Visual Studio Solution you will find PropertyBags something like this.

Property bags
Property bags

Open the Elements.xml and add the following code and specify the landing page. Home.aspx in the below example.

Advertisements

Getting started with Sharepoint projects in Visual Studio

I had just installed a fresh copy of Visual Studio 2012 and i also installed the latest Update 4. I tried to open my Visual Studio solution in it. I gave me a message project type not supported message.

Project not supported

It tried creating a new sharepoint project but it was missing, which must usually visible like in the below image

Sharepoint project
Sharepoint project

What i found out is that we need to install Microsoft Office Developer Tools for Visual Studio. It is an add-in for Visual Studio that enables developers to create, build, debug, run and publish apps and solutions for Office and Sharepoint. The Web Platform Installer usually installs it for you.

You can download it from here or here is the direct link.

Once you are done downloading, double click to install the app and you will find the options to create sharepoint apps.