I'm building an MVC application and I've noticed when I navigate through the app the layout gets reloaded along with my content.
I know this is default and expected behavior.
I'd really like to avoid reloading the layout, any thoughts?
I'm building an MVC application and I've noticed when I navigate through the app the layout gets reloaded along with my content.
I know this is default and expected behavior.
I'd really like to avoid reloading the layout, any thoughts?
You have minimum two abilities:
Main idea is load PartialView
with ajax requests and insert/replace content in DOM.
There is no way to instruct it to not reload the layout
The Layout gets rendered at the backend as soon as you request the url it returns a view that it redered with the layout .
However using ajax to load your views is bad for SEO you can do some workarounds. Or should i say SEO is stupid and someone should Fix that shit.
I posted a link to show you how the crawlers act when you have a ajax website
http://moz.com/blog/how-to-allow-google-to-crawl-ajax-content
There are some great frameworks out there like Backbone , angularjs,knockout that makes it simple to accomplish what you wanto do.