1

Is there a way in which I can construct a MVC page such that, if required, I can pull the contents of it without the entire HTML frame. I.e. I want to be able to, if required, pull just the contents (for AJAX Paging) without the refreshing the entire page, but I want that to be possible too

@{
    ViewBag.Title = "ViewDevice";
}

<h2>ViewDevice</h2>
Chris
  • 26,744
  • 48
  • 193
  • 345
  • 1
    I used webgrid http://stackoverflow.com/questions/8949003/asp-mvc3-webgrid-paging-and-filtering-by-ajax – Liviu May 24 '13 at 09:00

3 Answers3

3

You can use partial view to implement reusable part of a view and render it in any view you want like this @Html.Partial("_ViewDevice").

For more information on how to create a partial view see here and here.

Kambiz Shahim
  • 2,560
  • 14
  • 21
  • How would I get that view from jQuery? If I simply do `$.get("url")` will it work? – Chris May 24 '13 at 09:37
  • Yes, but with some modification, see [this](http://stackoverflow.com/questions/1570127/render-partial-view-using-jquery-in-asp-net-mvc) – Kambiz Shahim May 24 '13 at 09:42
2

Here is a great tutorial thats easy and quick:

http://www.joe-stevens.com/2011/05/30/asp-net-mvc-simple-server-side-ajax-paging-using-jquery/

Lasse Edsvik
  • 9,070
  • 16
  • 73
  • 109
0

check it out: https://github.com/kibiluzbad/Ifa

sample online demo: ifademo.apphb.com/

hope it helps

Luiz Freneda
  • 112
  • 1
  • 5