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" ...
Get Beginning Microsoft® Visual C#® 2008 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.