简体   繁体   中英

MVC Partial Page Refresh

I am using MVC 5 to render an initial view and Kendo MVVM with WebApi to populate controls with data. The view returned from the controller is essentially a SPA application. After the initial render of the view all further activity on the page is achieved via Kendo MVVM and WebApi (client side script).

The menu for the application initially used @Url.Action links to present a new View. The issue with this approach is that a full page refresh redraws the entire screen including top and side navs every time an action link is clicked.

I replaced the @Url.Action links with @Ajax.ActionLink and modified the controllers to return Partial Views. The @Ajax.ActionLink enables the rendering of the Partial View into a target Html element ( div ).

Given the application is essentially a Html 5 application rather than a pure MVC application, is this the best way to avoid full page refresh on selection of a new menu item?

Secondly, should I be using RenderBody() or is there a better approach?

regards Barry

Try This sample jquery Code Button Or Any control click Or Control Change Event

var url= '/Service/Grid';
$("#DivID").load(url);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM