1

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?

2 Answers 2

4

You have minimum two abilities:

Main idea is load PartialView with ajax requests and insert/replace content in DOM.

Sign up to request clarification or add additional context in comments.

2 Comments

I feared that, I've done this function to update content async. I think I don't have many choices here. Thank you for your response.
@Esteban If you want only content, without html-markup, then look at client templating, for example this JsRender: Demos. Server return json and then you fill your page.
1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.