1

I've just started to use ASP.NET MVC 4 in VS2010.

The Views cause a full page load i.e. the Master Layout page is also called and the entire page reloads. How can I load just the inner html, like an SPA app. I'd like to navigate between 2 forms without reloading the entire View and Master Layout.

Are Partial Views of any use here?

learnerplates
  • 4,257
  • 5
  • 33
  • 42

1 Answers1

1

Conceptual answer.

The solution is to load Partial View with AJAX. So you need to expose both two forms as Partial Views and then do not forget to also do AJAX POST to the POST MVC action (help) in order to save form data.

Some details:

Load partial view with AJAX: How Can I Render a Partial View via AJAX? Post partial view with AJAX: Return a PartialView from $.Ajax Post (here do not to forget to get form data and seririalize them - jquery form.serialize and other parameters)

Community
  • 1
  • 1
Peter Stegnar
  • 12,615
  • 12
  • 62
  • 80
  • Thanks Peter, I'm looking into this. I initially hoped that Razor would have a solution. I'll get back to you when I've sorted this. – learnerplates Mar 08 '13 at 14:46