Thursday, December 8, 2011

Creating a visual web part

1) Creating a share point empty project

2) Add a Visual Web part Item page  using sand boxed solution.

They can be deployed by the  site collection administration. where as farm solutions can only be deployed by the server administrator.

A web solution package file contains the set of features application pages, web user controls, web part dll, Event  Receivers etc. in a compressed format.

To create a sand boxed solution :

While creating the share point project save it as a sand boxed solution
file --> New Project --> Empty Share point Project --> visual web part --> sand boxed solution

Code in the sand boxed solution cannot access any content or functionality outside the site collection in which it is deployed.

To create the WSP file right click on the project and choose package this will create a wsp file under BIN-->Debug folder.

To use the sand boxed solution in a specific site collections:

Site Action --> Site Settings --> Galleries --> Solution --> Solutions tab( on the top) --> Upload WSP file --> Add to its solution --> Activate.

Using a Farm Solution:

File--> New Project --> Empty SharePoint project --> Deploy it as a farm solution --> Add Feature --> Title --> Right click on the project and choose package.