I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have a masterpage set up to simplify the layout and to keep the content pages for content rather than content and layout.
The navigation is list, css’d so it looks like a bar. In order to highlight the page on the bar, the list item needs to look like this <li id='current'>. I do not want to use <asp:ContentPlaceHolder> if I can avoid it. Is there some code I can add to each of my pages (or just to the masterpage?) to accomplish this or am I stuck using <asp:ContentPlaceHolder>‘s?
Add a property to your master page called Page Section
Add a MasterType page directive to the top of your content pages
In your content page code behind, set the PageSection property of the master page
In your master page, make the body tag a server tag
In the master page code behind, use that property to set a class on the body tag
Give each of your nav items a unique ID attribute.
In your css, change the display of the nav items based on the current page class