I'm building a site using ASP.NET MVC with lots of jQuery and AJAX stuff, and I'd like the main menu to work with AJAX as more or less the rest of the site does.
In an ideal scenario, I would like my main menu to 1) load the main content with AJAX if the user has activated javascript 2) change the url in the address bar (to enable link copy-pasting) 3) have my code in only one place, meaning that I don't want to have the same markup in an .aspx View and an .ascx PartialView.
Number 1) I have no problems with. However, I have no idea how I do to accomplish number 2) without a reload of the page. Any ideas?
I realize that the third issue could be solved by creating a View that renders each PartialView, but is there no nicer way around that? Some way to "wrap" the PartialView in the site Master or something at the Controller, before returning it to the client?