Book Image

Microsoft SharePoint 2010 Development with Visual Studio 2010 Expert Cookbook

By : Balaji Kithiganahalli
Book Image

Microsoft SharePoint 2010 Development with Visual Studio 2010 Expert Cookbook

By: Balaji Kithiganahalli

Overview of this book

Microsoft SharePoint 2010, is the best-in-class platform for content management and collaboration. With the combined capabilities of Sharepoint and Visual Studio, developers have an end-to-end business solutions development IDE. To leverage this powerful combination of tools it is necessary to understand the different building blocks. This book will provide necessary concepts and present ways to develop complex business solutions and take them further.SharePoint 2010 Development Cookbook With Visual Studio 2010 is an instructional guide for developing and debugging applications for SharePoint 2010 environment using Visual Studio 2010. The cookbook approach helps you to dip into any recipe that interests you, you can also read it from cover to cover if you want to get hands on with the complete application development cycle.With this book you will learn to develop event handlers, workflows, content types, web parts, client object model applications, and web services for SharePoint 2010 in an instructional manner. You will discover the less known facts behind debugging feature receivers, deployment of web parts, utilizing free toolkits to enhance the development and debugging experience. You will learn the newer development approach called Visual Web Parts, how to develop and deploy Silverlight applications that can be used with Silverlight web part. You will also explore SandBoxed deployment model and its usage. You will create your own web services for SharePoint and the Client Object Model introduced in SharePoint 2010. All in all, you will develop Sharepoint solutions in an instructional manner that eases the learning process.
Table of Contents (15 chapters)
Microsoft SharePoint 2010 Development with Visual Studio 2010: Expert Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Microsoft SharePoint 2010 is the best-in-class platform for content management and collaboration. With Visual Studio, developers have an end-to-end business solutions development IDE. To leverage this powerful combination of tools it is necessary to understand the different building blocks of SharePoint. This book will provide necessary concepts and present ways to develop complex business solutions and take them further.

SharePoint 2010 Development with Visual Studio 2010 Expert Cookbook is an instructional guide for developing, debugging and deploying applications for SharePoint 2010 environment using Visual Studio 2010. The cookbook approach helps you to dip into any recipe that interests you or you can also read it from cover to cover if you want to get hands on with the complete application development cycle.

With this book you will learn to develop event handlers, workflows, content types, web parts, client object model applications, and web services for SharePoint 2010 in an instructional manner. You will discover the less known facts behind debugging feature receivers, deployment of web parts, utilizing free toolkits to enhance the development and debugging experience.

You will learn the newer development approach called Visual Web Parts and how to develop and deploy Silverlight applications that can be used with Silverlight web parts. You will also explore the SandBoxed deployment model and its usage. You will create your own web services for SharePoint and learn more about the Client Object Model introduced in SharePoint 2010. All in all, you will develop SharePoint solutions in an instructional manner that eases the learning process.

What this book covers

Chapter 1, List and Event Receivers: Event Receivers are used for responding to events raised by SharePoint on lists, features, list items, and so on. This chapter not only provides an overview of the event receivers that can be developed using Visual Studio 2010, but also guides you through the step-by-step process of creating them and applying them to real world scenarios.

Chapter 2, Workflows: In this chapter, you will learn about sequential workflows, site workflows, and deploying custom initiation forms with workflows using ASPX pages and InfoPath forms. You will also learn to create custom InfoPath task forms with the workflows.

Chapter 3, Advanced Workflows: In this chapter, you will learn Advanced Workflow topics such as creating custom activity for both sandboxed and non-sandboxed environments. You will not only learn how to create state machine workflows but also to model them. This chapter also guides you through the process of creating a Pluggable workflow service. Last but not least, this chapter also guides you through the process of changing workflow statuses.

Chapter 4, List Definitions and Content Types: In this chapter, we will discover the world of content types. We will use object models to create content types, add new columns, document templates, and workflows to content types using Visual Studio 2010. This chapter also guides you through the process of creating external content types that are linked to external data source such as the SQL Server database. In the end of the chapter, we will also learn how to create list definitions using Visual Studio.

Chapter 5, Web Parts: In this chapter, we will discover visual web parts, code-only web parts, AJAX enabled web parts, and Silverlight web parts. The chapter also provides details on connectable web parts and adding configuration properties to web parts. This chapter also provides detailed information on versioning and deployment of web parts.

Chapter 6, Web Services and REST: In this chapter, we will learn about using REST services to extract data from SharePoint. We will create client applications that make use of REST to extract data from SharePoint. We will also learn to create custom SharePoint WCF web services.

Chapter 7, Working with Client Object Model: SharePoint 2010 introduced the new Client Object Model which can be used to create client applications that use SharePoint as a backend data store. In this chapter, we will learn all the three client object models such as the managed object model, the JavaScript object model, and the Silverlight object model. We will also learn the exception handling techniques and asynchronous calling of these object models.

What you need for this book

This book presents a series of projects that demonstrates the features of SharePoint 2010 and Visual Studio 2010. In order to gain hands on experience of these features, it is recommended that you have a 64-bit Windows development machine with lots of memory. Chapter 1, List and Event Receivers of this book provides the list of software and links that you can refer to set up your development environment. If you do not have a license for this software, you can always get the trial version from the Microsoft website.

Alternatively, you can read through this book without working through the projects. There are plenty of screenshots that provide a good sense of how these solutions work. This is not a suitable approach for beginner programmers.

Who this book is for

This book is for .NET developers to understand the building blocks of SharePoint 2010. Although the book can be used by beginners, it is recommended that the readers have an understanding of the previous versions of SharePoint. Developing SharePoint solutions requires solid understanding of ASP.NET architecture. The book assumes that the reader is familiar with ASP.NET technology and development concepts.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

private string GetInitiationData()
  {
    return this.txtCreditAmount.Text;
  }

Any command-line input or output is written as follows:

Add-SPSolution –LiteralPath <Location of your wsp>
Install-SPSolution -Identity <WSPName> -WebApplication <URLname>
Enable-SPFeature FeatureFolderName -Url <URLName>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Select File | New | Project. The new project wizard dialog box as shown will be displayed (Make sure to select .NET Framework 3.5 in the top drop-down box)".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.