Rated
Read 29,608 times
Contents
Related Categories
New features for web developers in ASP.NET 2.0 - Consistent Page Design with Master Pages
Consistent Page Design with Master Pages
This article was originally published on DNJ Online
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.
Alex spent most of his earlier working life as a technical salesman, and has had a love-hate relationship with computers that goes way back to the Sinclair Z80 and the Oric Atmos. In 1996 he retired from full-time work to concentrate on writing and developing in the fast-growing arena of the Web. This coincided with the release of Microsoft ASP 1.0, and since then he has been involved almost exclusively in that area.
Alex has written or contributed to over 40 books on Web technologies for Wrox Press, Sams Publishing, APress! and Addison Wesley, predominantly on Microsoft ASP and ASP.NET, XML, and mobile device support. He has also contributed more than 20 articles to ASPToday, plus several to other ASP-related Web resources sites such as DevX and 15seconds.com.
He has presented sessions about Web technologies at four Wrox conferences, two ASPDevCon conferences, as well as Microsoft's PDC, Tech-Ed, ASP.NET Connections and VS-Live conferences. He has also conducted training sessions for McKesson HBOC, BMS Limited, and other local companies and developers on ASP.NET and XML. In addition he has provided talks and demonstrations for local Dot Net User Groups, DDG-UK, and even for user groups in exotic locations such as Vienna.
Alex has been awarded MVP status by Microsoft, and is also a member of the CodeWise community, the ASP.NET Insiders group, and the INETA Speaker Bureau. In what spare time is left, he runs his own software and consultancy company Stonebroom Ltd.
Comments
|