C
CJM
I have a site that is being built using master pages, and includes a menu
that I want to manipulate dynamically.
Specifically the currently-selected menu option is styled differently to the
others, as follows:
<div id="menu">
<ul>
<li class="current_page_item"><a href="/">Home</a></li>
<li><a href="/about/">About Us</a></li>
<li><a href="/services">Services</a></li>
<li><a href="/projects/">Projects</a></li>
<li><a href="/events/">Events</a></li>
<li><a href="/contact/">Contact Us</a></li>
</ul>
</div>
I want to be able to move the class from the first item, and apply it to the
oppropriate menu item for each page, during the Form_Load() event.
I know I could place the entire menu into it's own Content Placeholder, but
a) I thought doing it dynamically might be more sophisticated, and b) I just
want to know how to do it for the hell of it - it's a learning exercise.
I know I need to use FindControl. and I know there are complications
regarding naming containers, but I haven't managed to find or figure out the
right solution.
Thanks
Chris
that I want to manipulate dynamically.
Specifically the currently-selected menu option is styled differently to the
others, as follows:
<div id="menu">
<ul>
<li class="current_page_item"><a href="/">Home</a></li>
<li><a href="/about/">About Us</a></li>
<li><a href="/services">Services</a></li>
<li><a href="/projects/">Projects</a></li>
<li><a href="/events/">Events</a></li>
<li><a href="/contact/">Contact Us</a></li>
</ul>
</div>
I want to be able to move the class from the first item, and apply it to the
oppropriate menu item for each page, during the Form_Load() event.
I know I could place the entire menu into it's own Content Placeholder, but
a) I thought doing it dynamically might be more sophisticated, and b) I just
want to know how to do it for the hell of it - it's a learning exercise.
I know I need to use FindControl. and I know there are complications
regarding naming containers, but I haven't managed to find or figure out the
right solution.
Thanks
Chris