如何在页面之间导航时避免刷新布局视图 [英] How to avoid refresh of layout view when navigating between pages

查看:57
本文介绍了如何在页面之间导航时避免刷新布局视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个以上的页面,都使用相同的布局页面,我可以在页面之间导航,只刷新布局页面的正文部分。例如,如果我有一个列表页面并选择一个项目进入详细信息页面并且它们都包含相同的布局视图,我不希望重新加载包含菜单和页脚的布局,只是包含布局视图的页面类似于部分页面回发

解决方案

这里是Ajax开始运作的地方。使用Ajax。

您也可以尝试使用部分视图但是AJAX(异步javascript和XML)是最好的方式...

通过制作XmlHttpRequest对象来调用Ajax。

快乐编码

享受SD的

If I have a more than one pages, all using the same layout page, is there a way I can navigate between the pages and only refresh the body part of the layout page. For example if I have a list page and select an item to go to the detail page and they both contain the same layout view, I don't want the layout which contains the menu and footer to reload, just the page containing the layout view similar to a partial page postback

解决方案

Here is where Ajax comes into action.Use Ajax .
You can try with a Partial view too but AJAX (Asynchronous javascript and XML) is the best way...
Ajax is called by making XmlHttpRequest Object.
Happy coding
Enjoy SD's


这篇关于如何在页面之间导航时避免刷新布局视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆