On my pages I sometimes have a tab menu with the following HTML:
<div class="tabWrapper">
<div class="tab tabSelected"><a href="artworkHome.aspx">Home</a></div>
<div class="tab"><a href="#">Create New</a></div>
<div class="tab"><a href="#">Help!</a></div>
<div class="clear"></div>
</div>
Different groups of pages have different tabs obviously. But what is the best way to write these tabs onto a page without manually doing it with HTML each time, so that if I want to add a tab I don’t have to go through each page ensuring they are all the same?
Should I make my own control? What is the best way to load these tabs in a modularised way? Should I have a class which holds all the tab groups and builds the HTML?
Thanks for any help!
If they are static controls you are best off creating the Html in custom ascx controls and load them dynamically on the page. Once they are created you should look at using the OutputCache directive which will speed up the page rendering.