Tuesday, January 18, 2011

Sharepoint 2010 Website Hosting with Visual Web Parts

This is a tutorial to develop a simple Visual Web Part for SharePoint 2010.SharePoint is used for creating website with shareing your resources with others and also manage your important documents, publish it on www and also you edit you document. Through Sharepoint Development you can create dynamic webstie or business portal for your website also using with latest open source platform inclluding WordPress, Joomla etc.

SharePoint 2010 having one good feature for your website hosting for your SharePoint applications. Through SharePoint web hosting you can improve communications, efficiency and security for your organization

by giving secure place to manage your daily corporate activities

Open Visual Studio 2010

From the menu, select File –> New Project.

In the New Project dialog window, choose Visual C# –> SharePoint 2010.
Select Visual Web Part from the Project Items.


Give your project an appropriate name. I used “WPHello2010″.

Click on OK to proceed.

In the SharePoint Customization Wizard, provide the url of the SharePoint 2010 site on which you want to deploy your web part and set the trust level to “Deploy as a farm solution”.

I will in another blog explain sandboxed solutions. It is also possible to change the settings later (see the new ShrePoint tab in your Visual Studio Project Properties dialog – later in this tutorial)

Click on ‘Finish’ to allow Visual Studio to generate the project.


When VS2010 is done with generating the project files open the solution explorer pane and check out the new files which was automatically generated. This is a great improvement from the VS2007 way constructing a deployable web part solution!

You will see that a Feature was generated, a Pacakge was generated and a Visual Web Part was also generated.


In the Solution Explorer, select the project and view the properties in the Properties pane. You will see that you can set the “Active Deployment Configuration”. This setting will allow you to control the actions which gets executed when you deploy your web part from within Visual Studion. In a step below I will show how to setup your own custom actions profiles.

You will also see that you can set the Assembly Deployment Target. This is a great way to ensure that you assemblies are directly deployed to the GAC instead of the bin folder.

The Sandboxed solution is set to false – I will explain in another post.

The Site URL is the target SP2010 site where your solution (web part feature) will be deployed to

You will also notice the VisualWebPartUserControl.ascx which was automatically added.

Lets explore the new VS2010 Project Properties Dialog. (for information only)

You will see that a new “SharePoint” tab is now available – jipeee !!

On this tab you can setup and select a “Active Deployment Configuration” (ADC)

The selected ADC can contain a number of steps which gets executed in a specific order to control deployment and retraction of the solution.

Read More

4 comments:

  1. You made some good points there.I did a search on the topic and found most people will agree with your blog.Thanks.

    cloud hosting india

    ReplyDelete
  2. Very useful tutorial on developing a simple Visual Web Part for SharePoint 2010. Thanks for taking your time to discuss about it.

    domain register

    ReplyDelete
  3. Web hosting plays a vital role in increasing ranking because traffic of a website increases if the site is available on the internet.indian web hosting companies

    ReplyDelete
  4. really its nice and informative post with unique content so thanks for sharing such a useful information about Sharepoint Development.


    Ruby on Rails Development

    ReplyDelete