Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Posts Tagged ‘visual studio’

Create a SharePoint 2013 Development VM

Posted by Paul on March 10, 2015

In this article we can explore how to quickly acquire a SharePoint 2013 Development Virtual Machine.

Software Requirements

Following are the software requirements for a SharePoint Development VM:

1. Windows Server 2012

2. SQL Server 2012

3. Visual Studio 2013

4. SharePoint Server 2013

Azure VM

I am suggesting Azure VM for a Trial period of 30 days. Click on the link below to start with:

http://azure.microsoft.com/en-us/account/

You can use your personal email for registration. Click on MY ACCOUNT link on the top. You will get the page displayed below.

image

Click on the Management Portal from the left side bottom. You will get the portal shown below.

image

Here you can create & manage websites, virtual machines etc. Click on the VIRTUAL MACHINES item from the left pane. Then on the CREATE VIRTUAL MACHINE link.

image

In the appearing pane choose the COMPUTE > VIRTUAL MACHINE > FROM GALLERY option. Here you can select from pre-created templates. Using templates would save our time.

image

In the appearing page choose the following template.

image

The template Visual Studio Ultimate 2013 Update 4 on Windows Server 2012 is required as this installation will be having a PowerShell script on the desktop which will do the SharePoint 2013 installation.

We are first installing Visual Studio 2013 & then proceeding with SharePoint 2013 installation.

Click the Next button to continue.

image

Enter the machine, user information to continue.

On Page 3 you can choose the REGION closer to your location.

image

Select the default options in Page 4.

image

Click the TIK button for the installation to start. You will get the status shown below.

image

Once you see the status changed as Running (shown below)

image

Click on the CONNECT button from bottom row.

image

You should be getting a .RDP file. Open the file for Remote Desktop connectivity into the VM we created.

image

You can use the username & password given during VM creation. You will get the machine as shown below.

image

You are ready with th VM. For installing SharePoint 2013, we have to travel a bit more.

Run PowerShell scrip in the folder ConfigureDeveloperDesktop > Scripts > ConfigureSharePointForm.ps1 as shown below.

image

The script will install SQL Server & SharePoint. When prompted you have to respond with following:

1. Choose Yes for the policy prompt

2. Enter your username and password for Service Account prompt

It might take an hour for the operations to complete.

image

To ensure you are optimizing your credit usage, you need to SHUTDOWN the machine after use.

image

Summary

In this article we have explored how to create a SharePoint 2013 Virtual Machine with Development Tools ready.

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Site Workflow with While, IfElse, Code Activities

Posted by Paul on October 17, 2012

In this article we can explore using multiple activities in a Site Workflow created using Visual Studio 2010. The core activities we use here are:

  • Code Activity to execute custom code
  • While Activity to execute inner activities upon condition is true
  • IfElse Activity to execute branching activities based on condition
  • LogToHistoryList Activity to log information to Workflow internal history list

Scenario

A typical approval scenario is being addressed here. An Expenses list is given for approval. The entries having Amount lesser than 100 are Approved.

Pre-Requisites

Create a custom list named Expenses for using this example. Add some items into the new list as shown below:


Create Workflow

Open Visual Studio 2010 and create a new Sequential Workflow Project as shown below:


In the next page choose your site collection and click the Next button to continue.

In the appearing page choose Site Workflow as shown below:


In the last page choose the option to start workflow manually.

    

Now you will be getting the Workflow designer with default activity inside it.


Add Activities

Open Visual Studio Now you can drag and drop the following activities from the Toolbox:

  • 1 Code Activity
  • 1 While Activity & IfBranch Activity
  • 2 Code Activity inside If, Else branches
  • 1 LogToHistory Activity

As shown below:


Our idea is following:

  • Create property named CurrentItem of type object, Index of type integer
  • In the first Workflow Activated, fetch all the Expenses items
  • In the Code Activity initialize the Index field
  • Set While Activity condition until CurrentItem is not null
  • Set the If branch condition as Amount less than 100
  • Set the Else branch condition as Amount greater than or equal to 100
  • Set the Code Activity inside If branch, to update status as Approved
  • Set the Code Activity inside Else branch, to update status as Rejected
  • Use the LogToHistory activity for logging the workflow completion information

Create Entity, Properties & Fields

Please create the following class to hold the Expense Item, in order to give an Object Oriented Look and Feel.

    namespace ExpenseApprovalWorkflow

  {


public class ExpenseItem

{


  public int ID;


  public double Amount;

}

}

Inside the Workflow class, add the following properties and fields.

namespace ExpenseApprovalWorkflow.Workflow1

{


public sealed partial class Workflow1 : SequentialWorkflowActivity

{


List<ExpenseItem> Expenses = new List<ExpenseItem>();


int Index;


ExpenseItem CurrentItem

{


get

{


if (Index < Expenses.Count)


return Expenses[Index];


return
null;

}

}

}

}

The Expenses list holds the ExpenseItem type items. The Index property represents the current index of the item being processed.

Initiation Code

Back to the workflow designer, double click on the onWorkflowActivated step and add the following code.

private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)

{


using (SPSite site = SPContext.Current.Site)

{


using (SPWeb web = site.OpenWeb())

{


var items = web.Lists[“Expenses”].GetItems(“ID”, “Amount”);


foreach (SPListItem item in items)

{


ExpenseItem expenseItem = new
ExpenseItem();

expenseItem.ID = (int)item[“ID”];

expenseItem.Amount = (double)item[“Amount”];

Expenses.Add(expenseItem);

}

}

}

}

The code fetches all Expenses list items from SharePoint and adds them to the Expenses field of our workflow class.

Code Activity

Double click on the Code Activity item from workflow design view (second activity). In the appearing code window enter the following code.

private void codeActivity1_ExecuteCode(object sender, EventArgs e)

{

Index = -1;

}

The code initializes the Index field to -1. This field will be incremented in the while loop later.

While Activity

Now select the While activity from the workflow design view and choose Properties window. Choose the Condition property as Code Condition and set the Inner Condition property as WhileCodeCondition.

    

The WhileCodeCondition
represents the name of the method which evaluates the While condition and returns true / false to continue / terminate the workflow.

Paste the following code in the Workflow class view.

private void WhileCodeCondition(object sender, ConditionalEventArgs e)

{

Index++;

e.Result = (CurrentItem != null);

}

You can see the method name matches the property we have specified. The method intakes the ConditionalEventArgs for specifying the condition of while activity.

IfElse Activity

You can see that there are 2 branch activities for the IfElse activity.

    

Select the first branch item and open the Properties window. Here we can specify the following properties:

  1. Condition as Declarative Rule Condition
  2. ConditionName as IfCondition
  3. Expression as this.CurrentItem.Amount < 100

You can see them in the Properties window as shown below:

    

The ellipsis button as highlighted in red color can be used to create the Expression. There is auto-completion enabled in the appearing editor dialog.


Now select the second branch item and open the Properties window. Here we can specify the following properties:

  1. Condition as Declarative Rule Condition
  2. ConditionName as ElseCondition
  3. Expression as this.CurrentItem.Amount >= 100

Now our If and Else branches are ready to proceed with their Code activities.

Code Activity for If branch

Now double click on the Code Activity for the If branch.

    

In the appearing code view, enter the following code.

private void codeActivity2_ExecuteCode(object sender, EventArgs e)

{


using (SPSite site = SPContext.Current.Site)

{


using (SPWeb web = site.OpenWeb())

{


var item = web.Lists[“Expenses”].GetItemById(CurrentItem.ID);

item[“Status”] = “Approved”;

item.Update();

}

}

}

The code fetches the Expense Item by ID and updates the Status as Approved.

Code Activity for Else branch

Now double click on the Code Activity for the Else branch.

    

In the appearing code view, enter the following code.

private void codeActivity3_ExecuteCode(object sender, EventArgs e)

{


using (SPSite site = SPContext.Current.Site)

{


using (SPWeb web = site.OpenWeb())

{


var item = web.Lists[“Expenses”].GetItemById(CurrentItem.ID);

item[“Status”] = “Rejected”;

item.Update();

}

}

}

The code fetches the Expense Item by ID and updates the Status as Rejected.

LogToHistoryList Activity

This activity logs information into the History List of the site. Select the activity and set the following property:

    

This list is a hidden list and is not shown in the Quick Launch or All Site Content.

To view the list you need to type the List Name in address bar. For example:

    http://SERVER/Lists/workflow%20history/AllItems.aspx

You can see various entries in the History List as shown below:

Using the History List we can verify the workflow instances being executed and their log information for troubleshooting.

Deploy the Workflow

Now we are ready to execute our workflow. Build the project, Right click on the solution and Deploy it.

Inside SharePoint

Back in SharePoint choose the Site Workflows and start our workflow.

    

Wait for a while for the execution to be completed.


Back to the Expenses list you can see the Status column being updated for the items.


You can open the Workflow History list to view the log entry as shown below:


This concludes our playing with Workflow activities.

References

http://msdn.microsoft.com/en-us/library/ms446847.aspx

Summary

In this article we have explored creating a Site Workflow using multiple activities. To summarize with following are the activities we have explored.

  • IfElse activity
  • While activity
  • Code activity
  • LogToHistoryList activity

I hope this example should provide knowledge to address complex workflow scenarios in your programming life. The source code contains the example we have discussed.

Posted in C#, SharePoint | Tagged: , , , , , , , | Leave a Comment »

SharePoint 2010 – Project Items inside Visual Studio

Posted by Paul on May 25, 2012

In this article we can closely examine the SharePoint Project items and related topics. I believe that the previous article regarding installation of SharePoint Tools for Visual Studio 2010 is completed successfully.

We can see the following Project Items inside Visual Studio under the node SharePoint:

clip_image002

Each of the Project Item is described below:

Empty SharePoint Project

This is a template whose contents are common to all other templates.

It includes all the references needed for SharePoint development.

clip_image004

This template contains the Features and Package files needed for deployment.

clip_image006

Sequential and State Machine Workflow

Sequential Workflow refers to a series of business logic steps performed in sequence. State Machine Wofkflows are not performed in sequence, but carried out by actions and events. The workflow templates contain the items to create Sequential and State Machine Workflows. We can create site level or global workflows through these templates.

clip_image008

Site Definition

This project contains a site definition folder which includes the default aspx page for the site, site component file, site configuration file etc.

List Definition

This project template contains the List templates. It includes content type, list templates, event receivers etc.

Modules

The module template is used to include the manifest xml file and the notes about a project. It is not the Module concept in Visual Basic.

Visual Web Part

We can create Web Part using the designer inside Visual Studio. This project template contains supports Visual Web Parts.

Content Type

Content Types are information on data. For example a Task can be declared as a Content Type. Later Task can be used inside a List.

Apart from the custom properties, we need to explore the other topics related to SharePoint development using Visual Studio.

Sandboxed Solutions

A Sandboxed Solution is a new concept in SharePoint Foundation that allows the users to upload their own code solutions. The Sandboxed Solutions are viewable and validated by Administrators through the Solutions Gallery.

The Solutions Gallery can be accessed from Site Actions > Site Settings > Solutions.

clip_image010

We can view the resource usage of solutions and manage the quota from the Solutions Gallery.

clip_image012

References

http://msdn.microsoft.com/en-us/library/ee231554.aspx

http://msdn.microsoft.com/en-us/library/ee539083.aspx

Summary

In this article we have explored the Project Items inside Visual Studio and had an overview of the various aspects of SharePoint development. In the upcoming articles we can jump into coding solutions for SharePoint 2010.

Posted in C#, SharePoint | Tagged: , , | Leave a Comment »

SharePoint 2010 – Project Items inside Visual Studio

Posted by Paul on May 25, 2012

In this article we can closely examine the SharePoint Project items and related topics. I believe that the previous article regarding installation of SharePoint Tools for Visual Studio 2010 is completed successfully.

We can see the following Project Items inside Visual Studio under the node SharePoint:

clip_image002

Each of the Project Item is described below:

Empty SharePoint Project

This is a template whose contents are common to all other templates.

It includes all the references needed for SharePoint development.

clip_image004

This template contains the Features and Package files needed for deployment.

clip_image006

Sequential and State Machine Workflow

Sequential Workflow refers to a series of business logic steps performed in sequence. State Machine Wofkflows are not performed in sequence, but carried out by actions and events. The workflow templates contain the items to create Sequential and State Machine Workflows. We can create site level or global workflows through these templates.

clip_image008

Site Definition

This project contains a site definition folder which includes the default aspx page for the site, site component file, site configuration file etc.

List Definition

This project template contains the List templates. It includes content type, list templates, event receivers etc.

Modules

The module template is used to include the manifest xml file and the notes about a project. It is not the Module concept in Visual Basic.

Visual Web Part

We can create Web Part using the designer inside Visual Studio. This project template contains supports Visual Web Parts.

Content Type

Content Types are information on data. For example a Task can be declared as a Content Type. Later Task can be used inside a List.

Apart from the custom properties, we need to explore the other topics related to SharePoint development using Visual Studio.

Sandboxed Solutions

A Sandboxed Solution is a new concept in SharePoint Foundation that allows the users to upload their own code solutions. The Sandboxed Solutions are viewable and validated by Administrators through the Solutions Gallery.

The Solutions Gallery can be accessed from Site Actions > Site Settings > Solutions.

clip_image010

We can view the resource usage of solutions and manage the quota from the Solutions Gallery.

clip_image012

References

http://msdn.microsoft.com/en-us/library/ee231554.aspx

http://msdn.microsoft.com/en-us/library/ee539083.aspx

Summary

In this article we have explored the Project Items inside Visual Studio and had an overview of the various aspects of SharePoint development. In the upcoming articles we can jump into coding solutions for SharePoint 2010.

Posted in C#, SharePoint | Tagged: , , | Leave a Comment »

SharePoint 2010 – Starting Programming

Posted by Paul on May 25, 2012

In this article we can start with programming part of SharePoint 2010. Through programming we are able to get more control and flexibility over SharePoint. We can use Visual Studio to do the programming part with the support of SharePoint server side object model library.

Some of the advantages gained through programming SharePoint are:

· Server Object Model to Iterate over Lists and Libraries

· Content Type Creation

· Web Part Creation

· WorkFlow Creation

· Assembly Signing

· Business Data Connectivity Model Creation

· Site Definition Creation

· Automated Backup and Restore

Visual Studio

Here we are using Visual Studio 2010 to work with SharePoint 2010. You can use a 32 bit or 64 bit version of Visual Studio 2010.

Visual Studio 2010 Tools for SharePoint Development

After the Visual Studio 2010 is ready, you need to install the following component to start with:

· Visual Studio 2010 Tools for SharePoint

This tool helps with custom templates, automatic web part deployment to SharePoint server and other integration facilities.

Download

You can download the tool from the following link:

http://sharepointdevtools.codeplex.com/

According to the documentation the tool provides extensions to four core areas:

1. Environment

2. Exploration

3. Templates

4. Deployment

After installing the tool, start a New Project in Visual Studio and you will be able to see the following SharePoint project category:

clip_image002

For starting with select the Empty SharePoint Project template and click Ok button. The following site dialog box will be prompted.

clip_image004

Enter your site url, leave the other options as unchanged and click Finish button.

Now the Solution Explorer will look like below:

clip_image006

Try building the project and if the build succeeds your Visual Studio is ready for SharePoint 2010 development. We can explore the programming areas in the upcoming articles.

References

http://msdn.microsoft.com/en-us/magazine/ee309510.aspx

Summary

In this article we have explored the programming part of SharePoint 2010. Using Visual Studio we can gain control over the SharePoint sites and features. In the upcoming articles we can play around with the object model and features.

Posted in C#, SharePoint | Tagged: , , , | 2 Comments »

SharePoint 2010 – Starting Programming

Posted by Paul on May 25, 2012

In this article we can start with programming part of SharePoint 2010. Through programming we are able to get more control and flexibility over SharePoint. We can use Visual Studio to do the programming part with the support of SharePoint server side object model library.

Some of the advantages gained through programming SharePoint are:

· Server Object Model to Iterate over Lists and Libraries

· Content Type Creation

· Web Part Creation

· WorkFlow Creation

· Assembly Signing

· Business Data Connectivity Model Creation

· Site Definition Creation

· Automated Backup and Restore

Visual Studio

Here we are using Visual Studio 2010 to work with SharePoint 2010. You can use a 32 bit or 64 bit version of Visual Studio 2010.

Visual Studio 2010 Tools for SharePoint Development

After the Visual Studio 2010 is ready, you need to install the following component to start with:

· Visual Studio 2010 Tools for SharePoint

This tool helps with custom templates, automatic web part deployment to SharePoint server and other integration facilities.

Download

You can download the tool from the following link:

http://sharepointdevtools.codeplex.com/

According to the documentation the tool provides extensions to four core areas:

1. Environment

2. Exploration

3. Templates

4. Deployment

After installing the tool, start a New Project in Visual Studio and you will be able to see the following SharePoint project category:

clip_image002

For starting with select the Empty SharePoint Project template and click Ok button. The following site dialog box will be prompted.

clip_image004

Enter your site url, leave the other options as unchanged and click Finish button.

Now the Solution Explorer will look like below:

clip_image006

Try building the project and if the build succeeds your Visual Studio is ready for SharePoint 2010 development. We can explore the programming areas in the upcoming articles.

References

http://msdn.microsoft.com/en-us/magazine/ee309510.aspx

Summary

In this article we have explored the programming part of SharePoint 2010. Using Visual Studio we can gain control over the SharePoint sites and features. In the upcoming articles we can play around with the object model and features.

Posted in C#, SharePoint | Tagged: , , , | 2 Comments »

SharePoint 2010 – Creating a List Definition using SharePoint Designer

Posted by Paul on May 22, 2012

In this article we can experiment with List Definition creation using SharePoint Designer.

We can create List Definition using the following tools:

1. SharePoint

2. Visual Studio

3. SharePoint Designer

To proceed with run the SharePoint Designer application. Use the Open Site button to open the default SharePoint site. Now select the Lists and Libraries option from the left Navigation bar.

clip_image002

From the ribbon menu, use the Custom List button.

clip_image004

In the appearing dialog box enter the Name and Description for the List.

clip_image006

Click the OK button continue. The new List Definition will get added as shown below.

clip_image008

Now use the Edit Columns button from the ribbon menu.

clip_image010

You can see the default Title column already in the list. Add the following 2 columns using the Add New Column button from the ribbon menu.

clip_image012

· ContactName as Single line of Text

· Address as Multiple lines of Text

Now the Columns list look like below:

clip_image014

Click on the Save button from the Top menu.

clip_image016

Now you are ready with the new List Definition. Go back to SharePoint inside browser and you can see the new List there:

clip_image018

You can try adding a new item and the dialog window shows the columns we added.

clip_image020

Click the Save button and this concludes our List Definition creation using SharePoint Designer.

Summary

In this article we have experimented with List Definition creation using SharePoint Designer. Designer provides an easier way for Administrators.

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

SharePoint 2010 – Creating a List Definition using SharePoint Designer

Posted by Paul on May 22, 2012

In this article we can experiment with List Definition creation using SharePoint Designer.

We can create List Definition using the following tools:

1. SharePoint

2. Visual Studio

3. SharePoint Designer

To proceed with run the SharePoint Designer application. Use the Open Site button to open the default SharePoint site. Now select the Lists and Libraries option from the left Navigation bar.

clip_image002

From the ribbon menu, use the Custom List button.

clip_image004

In the appearing dialog box enter the Name and Description for the List.

clip_image006

Click the OK button continue. The new List Definition will get added as shown below.

clip_image008

Now use the Edit Columns button from the ribbon menu.

clip_image010

You can see the default Title column already in the list. Add the following 2 columns using the Add New Column button from the ribbon menu.

clip_image012

· ContactName as Single line of Text

· Address as Multiple lines of Text

Now the Columns list look like below:

clip_image014

Click on the Save button from the Top menu.

clip_image016

Now you are ready with the new List Definition. Go back to SharePoint inside browser and you can see the new List there:

clip_image018

You can try adding a new item and the dialog window shows the columns we added.

clip_image020

Click the Save button and this concludes our List Definition creation using SharePoint Designer.

Summary

In this article we have experimented with List Definition creation using SharePoint Designer. Designer provides an easier way for Administrators.

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

SharePoint Designer 2010

Posted by Paul on May 2, 2012

In this article we are going to explore SharePoint Designer. It is another great tool to work with SharePoint. It is a free tool and can be used for editing of items inside SharePoint.

Features

Some of the cool features of Designer are:

· It is Free

· WYSIWYG (What you see is what you get) Editor

· No Coding Required

· Useful for Administrators as well as Developers

· Workflow Creation

· Editing of Site, Styles Possible using Designer

· Branding

· Form Customizations

· Visio Integration

· InfoPath Forms Data Source Configuration

· Manage Site Permission, Site Columns etc.

· BCS (Business Connectivity Configuration)

· Create Content Types

· ASP.NET, XML, XSLT, RSS, XHTML support

· SOAP and REST support

· Administrator can restrict the use of Designer on sites

Version

The version compatible with SharePoint 2010 is SharePoint Designer 2010.

The previous version of designer was SharePoint 2007. The ancestor of SharePoint Designer is Microsoft FrontPage which was a web editor of the times.

Download Link

You can use the following links to download the 32bit and 64bit version of Designer 2010:

http://www.microsoft.com/download/en/details.aspx?id=16573

http://www.microsoft.com/download/en/details.aspx?id=24309

Enabling/Disabling Designer Features

To enable/disable the features of SharePoint Designer use the following item:

Site Actions > Site Settings > Site Collection Administration > SharePoint Designer Settings

clip_image002

You can change the following options on the above screen:

· Enable / Disable SharePoint Designer for the Site

· Enable / Disable detaching page from the site definition

· Enable / Disable customizing master pages

· Enable / Disable managing of web site url feature

Running SharePoint Designer

After the installation you can execute SharePoint Designer using the following link:

All Programs > SharePoint > Microsoft SharePoint Designer 2010

Following is the application snapshot on executing the above link:

clip_image004

Use the Open Site button and you will get the following dialog:

clip_image006

Enter the site url and click the Open button. Enter the credentials in the appearing dialog.

You will get the site opened in the main Designer window as shown below:

clip_image008

The left side pane shows various features of the site like:

· Lists and Libraries

· Workflows

· Site Pages

· Site Assets

We can select the item from the left pane and the properties are displayed on the right side.

Customizing Site Pages

Now we can try customizing an existing page using SharePoint Designer. For this create a new list named contacts in the site deriving from the Contacts template.

Refresh the site in the Designer using the button on left top system menu.

clip_image010

Now select the Lists and Libraries item from the left pane. You will be able to see list named contacts.

clip_image012

Click on the contacts item and you will get the properties of it.

clip_image014

You can see 3 forms on the Forms pane which are described below:

Form

Description

DispForm.aspx

Used to display the item details (View command)

EditForm.aspx

Used to edit the item details (Edit command)

NewForm.aspx

Used to add a new item (New command)

Now we can add a new page and apply the Display (View command) to it. Click on the New button from the Forms pane. Enter the following details in the appearing dialog.

clip_image016

Click the Ok button to continue. Now the new form gets added and acts as the default View form. You can try changing the color of the form labels, deleting some rows, adding a hyper link, custom formatting etc. After the changes click the Save button and you are ready to check the edited page inside SharePoint. (Use the Refresh button to get the controls)

Inside SharePoint site, add a new contact and use the View Item command for the newly added item. You can see the following screen:

clip_image018

Note

Please make sure that you are editing only the new custom form. Changing the SharePoint pages may create problems and hence not advisable to new users.

Editing Master Pages and CSS

We can also edit the Master Pages using the left side link Master Pages.

clip_image020

Click on the v4.master item and it will get opened as shown below. Use the Edit File option from the appearing page.

clip_image022

clip_image024

You can modify the control properties in the appearing window. There is an option on the bottom of Designer to switch to the Code View from the Design View.

clip_image026

Editing CSS (Cascading Style Sheets)

As you might be knowing the CSS files determines the font sizes, colors and various attributes. Use the Style > Manage Style option to get the CSS properties.

clip_image028

You can see the Manage Styles properties window in the right end bottom of the designer.

clip_image030

Right click on the item, and use the Edit Item menu item. There you can change the style of the particular item. Any changes will get reflected in the SharePoint site on saving.

Working with Controls

We can add / edit controls to the custom pages or master page. Use the Insert menu option to add controls. You can choose from HTML, ASP.NET, SharePoint controls as shown below:

clip_image032

References

http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/04/01/new-features-in-sharepoint-designer-2010.aspx

http://blogs.msdn.com/b/sharepointdesigner/

Summary

In this article we have explored about SharePoint Designer. The Page Customization, Master Page Editing facilities using the Designer were explored.

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

SharePoint 2010 – Web Parts

Posted by Paul on May 2, 2012

Web Parts are rectangular areas of HTML content. We can provide information to the users using Web Parts. The history of Web Parts starts from year 2000 in the name Digital Dashboard. Later it evolved as Web Parts and includes support in SharePoint Designer and Visual Studio. We can use the existing web parts or build custom web parts for SharePoint.

SharePoint 2010 contains inbuilt web parts and provides custom web part integration facilities. Web Parts provides set of controls to display, modify, and configure the contents.

Example of Web Part

clip_image002

Adding a WebPart

For starting with open our site collection using the url.

clip_image004

We can start by adding an image WebPart to the main page. Click on the left top menu Site Actions > Edit Page option.

clip_image006

On the appearing screen below, click on the first Add a Web Part button.

clip_image008

The following options appears:

clip_image010

Select Media and Content from the first pane and Image Viewer from the second pane and click the Add button. Now the Web Parts gets added into the page.

clip_image012

Use the open the tool pane option and enter an image url inside it, then click the Apply button.

clip_image014

Now click the Stop Editiong button from the ribbon menu.

clip_image016

Now you are ready with the main page with an image as shown below.

clip_image018

Editing a Web Part

We can edit a web part by logging in as a user with permissions to edit and using the Edit Web Part option from the right side context menu of the web part.

clip_image020

Deleting a Web Part

To delete an existing Web Part, use the Edit Web Part option from the context menu.

clip_image022

Then use the Delete option again from the Web Part context menu.

clip_image024

Now the Web Part gets deleted.

Using List Web Parts

We can use List Web Parts to show the custom Lists made inside SharePoint. Use the Add web part option to locate the Lists and Libraries category as shown below:

clip_image026

There we can locate the custom List created inside SharePoint. The List Web Part allows us to add the List to other sites through web parts.

Silverlight Web Part

Another notable feature in SharePoint 2010 is the Silverlight web part. Using the Silverlight web part we can now host silverlight applications inside SharePoint. The XAP files needed to be located for the web part.

To add a silverlight web part use the Media and Content category from the Add Web Part dialog as shown below:

clip_image028

Web Part Galleries

The Web Part Gallery provides a view on the installed web parts for a site collection. You can access this window from Site Settings > Galleries > Web Parts.

clip_image030

On clicking the above link you can see the page as shown below:

clip_image032

We can create our custom web part and deploy it to the SharePoint server. These topics are discussed in advanced chapters. The web parts will be having extension .dwp expanding as Dashboard Web Part.

References

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx

Summary

In this article we have explored the Web Part feature, Adding/Editing/Deleting Web Parts, Silverlight Web Part, Web Part Galleries etc.

The key points of web parts would be:

· A rectangular area of HTML content

· Flexible piece of Functionality

· Users can manage adding/deleting web parts

· Custom web part creation is possible

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »