Library tutorials & articles

New features for web developers in ASP.NET 2.0

Consistent Page Design with Master Pages

This article was originally published on DNJ Online
DNJ

Consistent Page Design

Most Web sites maintain a consistent ‘look and feel' across the pages using standard sections of HTML or dynamic content that is injected into every page - perhaps using #include directives, or through user controls. In version 2.0, Microsoft has added a new feature called Master Pages which allows you to create the outline for all your pages as a single template file, and then insert the content that differs on each page into this. You can include headers, images, menus, and other content in the master page, and edit the master page at any time to change the appearance of the whole site.

Shown below is what happens in Visual Studio 2005 when you are working on a section of content that uses the common UI from a master page: the master page content is visible, but greyed out because it cannot be edited in this view.

Furthermore, by taking advantage of the new navigation controls included in version 2.0, you can easily add dynamic menus and other features to the master page, or indeed any other ASP.NET page. There are Menu and TreeView controls to provide the visible menu in the page, and a SiteMapPath control that automatically provides a ‘breadcrumb trail' indication of the location of the current page within the site's page hierarchy. All these are powered by a special data source control named SiteMapDataSource which works with an XML file that defines the structure of your site. There's also the new ImageMap control which makes it easy to create clickable image maps, and handle user interaction as they click on the image map.

Other new features help to make page design easier, and support visitors with special needs. You can add custom styles to sets of UI controls as a single operation through the new Themes feature; make it easier for visually-impaired visitors to access the site by taking advantage of new accessibility support features of many of the ASP.NET server controls; and use the built-in Internationalization features to support multiple languages.

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of New features for web developers in ASP.NET 2.0.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related podcasts

  • CodeCast Episode 4: State of .NET, IE8, ASP.NET MVC, and O'Reilly Media

    CodeCast Episode 4: State of .NET, IE8, ASP.NET MVC, and O'Reilly MediaHosts Ken Levy and Markus Egger discuss the new State of .NET events, IE8, ASP.NET MVC, followed by an interview from PDC with two editors from O'Reilly Media. More on ASP.NET MVC can be found at http://asp.net/mvc. Interview...

Related jobs

Events coming up