Author: LonelyPixel2 | Posted on: 6/20/2008 7:37:11 AM | Views : 318

Hi,
I have a bunch of <a> link elements on my .aspx page that represent navigation items. Each of them points to a different page. The one that points to the currently viewed page should have a CSS class assigned so that it's displayed in a highlighted way. But how can I add that CSS class for the currently selected link item?
In PHP, I would have written the entire link item with code, right there where it shall appear in the page output, printing that class="" attribute with it or not. Or I would have put a <?php ... ?> section right inside of the <a> element, again printing the class attribute or not. Both doesn't seem to be possible with ASP.NET. The solution that I do see right now is to create a custom control that prints the link items. I've done that for a really complex table on one of the pages, but it seems a bit overkill for a handful of navigation items on a master page. What do you think? From my limited knowledge poi ...

Go to the complete details ...