A.7. Chapter 7

A.7.1.

A.7.1.1.
A.7.1.1.1. Exercise 1 solution

To change the items of the Menu control, two main groups of style properties are available. The properties in the first group all start with Static and refer to the main menu items that are shown when the page first loads. The StaticMenuStyle applies to the entire menu, while StaticMenuItemStyle, StaticHoverStyle, and StaticSelectedStyle are used to change the appearance of the actual menu items in various states (normal, when moused over, and when they are the active menu item).

For the subitems, the same style properties are available, but they all start with Dynamic instead of Static.

A.7.1.1.2. Exercise 2 solution

To redirect a user to another page programmatically, you can use Response.Redirect and Server.Transfer. The first option sends a redirect instruction to the browser and is thus considered a client-side redirect. Server.Transfer, on the other hand, takes place at the server, allowing you to serve a different page without affecting the user's address bar.

A.7.1.1.3. Exercise 3 solution

To display a TreeView that doesn't have the ability to expand or collapse nodes, you need to set the ShowExpandCollapse property of the TreeView to False.

Get Beginning ASP.NET 3.5: In C# and VB 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.