O'Reilly logo

Beginning Microsoft® Visual C#® 2008 by Eric White, Morgan Skinner, Jon D. Reid, Jacob Hammer Pedersen, Christian Nagel, Karli Watson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 20. Advanced Web Programming

In Chapter 19, you learned about base features of ASP.NET, how server-side controls can be used to render HTML code to the client, input validation, and state management. You've also learned how security can be added, and how to read/write data from/to the database. This chapter looks at user interface elements and customization of Web pages with profiles and Web parts. Master pages are used to define a frame for multiple pages. You can use site navigation to define the structure of your Web site, making menus to access all the pages. To reuse controls within multiple pages on the same Web site, you can create user controls. The last section of the chapter describes Web parts, which you can use to create a portal Web site.

In this chapter, you learn about the following:

  • Creating and using master pages

  • Creating and using user controls

  • Setting up navigation within Web sites

  • Using profiles

  • Using Web parts

  • Coding with JavaScript

Master Pages

Most Web sites reuse part of their content on every page—things such as company logos and menus are often available on all pages. It's not necessary to repeat the common user interface elements with every page; instead, the common elements can be added to a master page. Master pages look like normal ASP.NET pages but define placeholders that are replaced by content pages.

A master page has the file extension .master and uses the Master directive in the first line of the file, as shown here:

<%@ Master Language="C#" AutoEventWireup="true" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required