0

I'm trying to figure out a way to load a section of my page dynamically with MVC. Currently I have a top menu, and side menu to the left that are shared layout. The main content is within the id "page-content-wrapper". The code looks as follows:

@{
  ViewBag.Title = "Role";
  Layout = "~/Views/Shared/_Layout.cshtml";
}

<div id="wrapper">

  @*Sidebar*@
  @Html.Partial("_Sidebar")


  @*PAGE CONTENT*@
  <div id="page-content-wrapper">

      <div>content</div>

  </div>@*page-content-wrapper*@
</div>@*wrapper End*@

In the page-content-wrapper section I'd like to switch between views, but not reload the entire page. Would AJAX panels be a good option? Or are there any online tutorials to assist me? Any options that will allow my page to run efficiently are welcomed.

Thanks for any help.

Justin
  • 95
  • 2
  • 6
  • there are many guides online, and many question answered on stackoverflow, here's one of 'em - http://stackoverflow.com/questions/1570127/render-partial-view-using-jquery-in-asp-net-mvc – Ziv Weissman May 08 '15 at 16:26
  • [AJAX panels don't work in MVC](http://stackoverflow.com/questions/961612/how-to-make-update-panel-in-asp-net-mvc), your thinking of webforms – Liam May 08 '15 at 16:31

1 Answers1

0

ASP.NET MVC is mostly a server-side front-end Web development tool. It won't assist you in your goal, also known as single page application.

Actually, you should leverage a HTML5/JavaScript solution to get an optimal result and move on, and today there're many single page application frameworks you can plug in your ASP.NET MVC application. For example, AngularJS + UI Router.

Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206