In your master page add the following code....
Private mSelMenuItem as string = nothing
Public property SelMenuItem as string
get
return mSelMenuItem
end get
set (value as string)
mSelMenuitem = value
end set
end property
Public Function GetMyMenuState(ForThisMenuItem as string) as string
If ForThisMenuItem = mSelMenuItem Then
Return ("class=" & chr(34) & "active" & chr(34) & " ")
Else
Return ("class=" & chr(34) & "inactive" & chr(34) & " ")
End If
End Function
then... in EACH of your CONTENT Pages in the
form load event add a SINGLE statement to identify the page to the master page...
like this for the homepage...
me.master.SelMenuItem = "Home"
or like this for services page
me.master.SelMenuItem = "Services"
Then in your masterpage where the menu is....
you can use it like this ...
<li><a href="homepage.aspx" <%=GetMyMenuState("Home") %>>Home</a></li>
<li><a href="services.aspx" <%=GetMyMenuState("Services") %>>Services</a></li>