在不更新网页的情况下显示数据 [英] Display data without Updating the webpage
本文介绍了在不更新网页的情况下显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在网页上显示数据而不刷新整个网页。
当我点击其中一个红色按钮时,数据库中刷新的数据应显示而不更新整个网页。
我不知道怎么做。
今天,我正在使用SQL Server 2012和VS 2012与实体框架和ASP.net MVC。
I would like to display data in the webpage without refreshing the whole webpage.
When I click one of the red button, the refreshed data from the database shall be displayed without updating the whole webpage.
I don't know how to do it.
Today, I'm using SQL server 2012 and VS 2012 with entity framework and ASP.net MVC.
推荐答案
只需使用ajax,如下所述:https://cmatskas.com/update-an-mvc-partial-view-with-ajax/ [ ^ ]。当然,您可以在控制器中使用jquery和ajax来更深入地控制您检索的内容及其显示方式。这取决于您的需求。
Simply use ajax, like described here: https://cmatskas.com/update-an-mvc-partial-view-with-ajax/[^]. Of course, you can use jquery and an ajax backedn in a controller to have even deeper control over what you retrieved and how it is displayed. It depends on your needs.
这篇关于在不更新网页的情况下显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文