Book Image

Enhancing Microsoft Content Management Server with ASP.NET 2.0

By : Lim Mei Ying, Spencer Harbar, Stefan Gossner
Book Image

Enhancing Microsoft Content Management Server with ASP.NET 2.0

By: Lim Mei Ying, Spencer Harbar, Stefan Gossner

Overview of this book

The release of Microsoft Content Management Server (MCMS) Service Pack 2 opens up the world of ASP.NET 2.0 to MCMS developers. Written by the masters of MCMS, this book shows you how to use the new features of ASP.NET 2.0 that everyone is talking about in your MCMS development. You will first learn how to install and configure MCMS SP2. There are two approaches to setting up a development environment for SP2: an upgrade from a previous SP1a installation or starting from scratch and building a fresh installation including SP2. Of course, both approaches are covered. You will become familiar with the MCMS Service Pack 2 development environment, and create custom Visual Studio 2005 templates to overcome some of the issues which are present with the templates shipped with MCMS SP2. After that, its time to look at some of the most exciting features of ASP.NET 2.0, and how you can make use of them in MCMS: master pages, site navigation, themes, and the membership provider model. One of the coolest features introduced with ASP.NET 2.0 is master pages, which allow developers to enforce common layout and behaviour across pages within an application. You will learn about the benefits of using master pages and see a step-by-step guide for implementing them in your MCMS applications, where they become master templates! ASP.NET 2.0 introduces a whole new way of implementing site navigation, driven by site maps. By programmatically adding channels and postings to a site map you will see how to smoothly integrate these controls to any MCMS site. To customize the look of your site, we will see how a common look and feel can be applied efficiently to a MCMS site by using ASP.NET 2.0 themes. An essential customization required for themes to work correctly in an MCMS site is a must-read feature of this chapter. MCMS has its own role based authorization and user management system which cannot be extended. However, the new ASP.NET 2.0 Membership Provider Model and the shipped controls can be used within MCMS applications to improve the implementation of Forms Authentication and provide a more elegant solution for authenticating against an external store. A collection of tips and tricks round off the book, including using the Provider Model design pattern to ease migration to Office SharePoint Portal Server
Table of Contents (12 chapters)
Enhancing Microsoft Content Management Server with ASP.NET 2.0
Credits
About the Authors
About the Reviewers
Preface

Preface

Enhancing Microsoft Content Management Server with ASP.NET 2.0 delves into the integration of key ASP.NET 2.0 features such as Master Pages, Site Navigation, Themes and Skins, and the Membership Provider Model with Microsoft Content Management Server 2002 (MCMS) Service Pack 2.

Each chapter builds upon the last, walking through these new features available to MCMS developers and building a sample site similar to that presented in our previous book, Building Websites with Microsoft Content Management Server from Packt Publishing January 2005 (ISBN 1-904811-16-7).

What This Book Covers

Chapter 1 walks you through the installation and configuration of MCMS 2002 Service Pack 2 (SP2), along with SQL Server 2005 and Visual Studio 2005 on a single developer workstation. There are two approaches to setting up a development environment for SP2: an upgrade from a previous SP1a installation or starting from scratch and building a fresh installation including SP2. We will cover both approaches in this chapter.

In Chapter 2 we spend some time getting familiar with the MCMS Service Pack 2 development environment, which is slightly different from what we are used to with previous versions of MCMS and Visual Studio. We will cover these changes and a number of tips for working within the SP2 development environment, such as the creation of custom MCMS Visual Studio 2005 templates.

Chapter 3 introduces you to one of the best new features introduced with ASP.NET 2.0, master pages, which allow developers to enforce common layout and behavior across pages within an application. While at first pass many master pages concepts are similar to those of MCMS templates, there are a number of benefits to be gained by taking advantage of master pages within MCMS applications. This chapter

provides an overview of the benefits of using master pages and a step-by-step guide for implementing them in your MCMS applications, where they become master templates!

Chapter 4 covers the new ASP.NET 2.0 Navigation provider model and controls, and how to integrate them into your MCMS applications. Developing site navigation controls is an exercise that often leaves developers in a dilemma. Early versions of Visual Studio did not provide any ready-to-use navigation controls. Developers had to choose between spending many hours building controls from scratch or expand project budgets to purchase shrink-wrapped software.

In Chapter 5 we will see how a common look and feel can be applied efficiently to an MCMS site by using themes. We will create skins and cascading style sheets and demonstrate how they work together to define the appearance of a site. Finally, we will discuss an essential customization required for themes to work correctly in an MCMS site.

Chapter 6 covers the Membership Provider Model, one of the key new concepts introduced with ASP.NET 2.0, which makes it significantly easier to develop web applications that utilize third-party or custom membership stores. In addition ASP.NET 2.0 ships with a number of authentication controls related to role membership, which vastly reduce the amount of code required to implement forms authentication and associated functionality in your applications. This chapter shows how to use these features to improve the implementation of Forms Authentication and provides a more elegant solution for "account mapping" scenarios whereby authentication takes place against an external store and the accounts are mapped to Windows accounts for the purposes of MCMS authorization.

In Chapter 7 we present a number of tips along with code samples for working with ASP.NET 2.0 and MCMS SP2, and offer implementation advice for those considering migration to the upcoming Microsoft Office SharePoint Server 2007.

What You Need for This Book

This book has been written for MCMS developers who are comfortable with the material presented in our previous book, Building Websites with Microsoft Content Management Server, and have a solid grasp of C#. To use this book you need to have access to the following:

  • Visual Studio 2005 (any edition).

  • Microsoft Content Management Server 2002 Service Pack 2 (any edition). A 120 day evaluation of MCMS is available from http://www.microsoft.com/cmserver.

We walk through the various pre-requisites for installation in Chapter 1. All examples presented use Microsoft Windows XP Professional Service Pack 2.

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.

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

A block of code will be set as follows:

public string FirstName
{
get
{
return txtFirstName.Text.Trim();
}
}
// Last Name
public string LastName
{
get
{
return txtLastName.Text.Trim();
}
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

public string FirstName
{
get
{

return txtFirstName.Text.Trim();

}
}
// Last Name
public string LastName
{
get
{

return txtLastName.Text.Trim();

}
}

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

xcopy "MCMS_INSTALL_PATH\DevTools\NewProjectWizards80\Visual Web Developer" "PATH_TO_MY_DOCUMENTS_FOLDER\Visual Studio 2005\Templates\ProjectTemplates\Visual Web Developer"/E

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Note

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 drop an email to, making sure to mention the book title in 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 email.

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 the Book

Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.

Note

The downloadable files contain instructions on how to use them.

Errata

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

Questions

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