I have a site with a navigation bar defined in the layout. The navigation bar is used in several views of the site and has some dynamic content that is generated from a couple of queries in the Database.
I am wondering what is the best practice to render this menu (defined in a partial view).
As far as I know I can do it in two ways, with some advantages and disadvantages for each one:
Using Html.Action: + It's completely independent from the view that is using the layout - It adds an extra request to render a section of the page - I'm adding an Action method that returns a Partial view that is not called from Ajax.
Using Html.Partial: + A simple request to render the entire view - Each view model must contain the information required for the navigation bar
I would really appreciate your insights on this since I have several scenarios like this one on my site and I'm not sure which one is the best.
Thanks!