First, look here:
Using CSS and Styles with the Menu Control[
^]
This gives all the information needed to style an ASP.NET Menu.
Aside from that, you can always check the current URL against the menu to see if there is a match and dynamically add styling to that item. (this seems a bit brutish).
Also, another suggestion would be to use a Web.sitemap datasource instead of leaving the menu directly in the masterpage html (just a bit less messy and easier to manage in case you use the same sitemap elsewhere).
Unfortunately I can't reproduce the issue, I copied the html given and it works fine in my test environment (given I do not have you CssClasses so I just removed those and created my own).
If none of this works, could you post the css you have assigned for the menu?
Thanks for the CSS, I can say that solution 2 will get you most of the way:
<staticmenuitemstyle cssclass="selected" />
<staticselectedstyle cssclass="selected" />
you should make diffrent in cssclass of them
<staticmenuitemstyle cssclass="Menuselected" />
<staticselectedstyle cssclass="selected" />
This is true BUT you are still missing one thing, since you are coding the menu yourself in the html you also have to tell it which one is selected. As I suggested before, try to use a sitemap if possible as the datasource will give the menu your current position.
Aside from using a sitemap datasource, you can use codebehind as I mentioned before to tell the menu which item is selected on a given page. I have your html working with both a sitemap and codebehind selection. Without something telling your menu where you are in the site nothing will ever be set as "selected" and will never trigger that css.
If you are really set on using html code instead of a sitemap then to point you in the direction to set an item as selected, in the page load:
1) you need to get current URL
2) loop through the menu items
3) once you find a match, set that item to selected
Example:
String absoluteURL;
absoluteURL = Request.Url.AbsolutePath;
int tmpI = absoluteURL.LastIndexOf("/");
String finalURL = absoluteURL.Substring(tmpI + 1).ToLower();
for (int i = 0; i < Menu_SUPER_ADMIN.Items.Count; i++)
{
String tmpNav = Menu_SUPER_ADMIN.Items[i].NavigateUrl.ToLower();
if (tmpNav.Contains(finalURL))
{
Menu_SUPER_ADMIN.Items[i].Selected = true;
}
}