We use a single master page for three website "sections" but we want to the menu color scheme to change depending on the section. Would skins be the way to go and does the CSS-friendly menu play well with skins? Is it possible to set the CSS-friendly menu
properties programmatically? Seems like a lot of work to change menu item background colors but I like the look of what our designer proposed.
Came up with a solution. Based on the number of views this post has generated there doesn't seem to be much interest so I won't go into great detail. Post a response if you want me to expand on the solution.
The objective:
The menu control colors need to change based on the web section. Nested master pages won't work because of the menu placement.
The challenge:
Because it is not part of the framework we can't set CssSelectorClass in code behind.
The solution:
Created a simple menu class that allows me to pass the page category field value from the content page code behind.
Created a menu user control which contains the four menu controls. The user control code behind has a switch statement that sets the menu control visibility to true based on the page category value it gets from the menu class.
Incorporated the menu user control into the master page. All menu maintenance is now managed in the user control.
Member
93 Points
319 Posts
Set the CSS-friendly menu properties programmatically
Apr 01, 2008 04:30 PM|GDB|LINK
We use a single master page for three website "sections" but we want to the menu color scheme to change depending on the section. Would skins be the way to go and does the CSS-friendly menu play well with skins? Is it possible to set the CSS-friendly menu properties programmatically? Seems like a lot of work to change menu item background colors but I like the look of what our designer proposed.
Thanks!Member
93 Points
319 Posts
Re: Set the CSS-friendly menu properties programmatically
Apr 03, 2008 10:18 AM|GDB|LINK
Came up with a solution. Based on the number of views this post has generated there doesn't seem to be much interest so I won't go into great detail. Post a response if you want me to expand on the solution.
The objective:
The menu control colors need to change based on the web section. Nested master pages won't work because of the menu placement.
The challenge:
Because it is not part of the framework we can't set CssSelectorClass in code behind.
The solution:
Created a simple menu class that allows me to pass the page category field value from the content page code behind.
Created a menu user control which contains the four menu controls. The user control code behind has a switch statement that sets the menu control visibility to true based on the page category value it gets from the menu class.
Incorporated the menu user control into the master page. All menu maintenance is now managed in the user control.