I have to create a simple, one-level menu in an ASP.NET website clicking on whose items would result in displaying an apt .ascx file on the remaining screen area.
I would like to know which is the most suitable method to achieve this:
- ASP.NET Menu control
- HTML ul tag
- HTML table with hyper-links within the cells
- Any other way (which I wasn’t able to identify)
Apologies if it’s a silly question, but I am experimenting with and gradually taking up ASP.NET, so wanted to learn the best practices/usages.
Thanks for the help!
I would recommend using the menu control and minimal “lead-in” pages to host your ascx controls. Early on I used to use MultiView controls to minimize my page count (on a site that can exceed several thousand pages), but found that this method required a lot of extra effort to provide for hard linking to a particular section and ultimately didn’t decrease page count because you still have a separate ascx for each piece of functionality. If you have a bare-bones aspx page that holds the master page reference (if used) and a registration to the WebUserControl you’re using, that will keep things brief and controllable. As @XIII mentioned, you will also be able to use a sitemap or xml file to bind to the menu object.