Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何每秒自动刷新 MVC PartialView
我想每 30 秒刷新一次 MVC 中的部分视图。我怎样才能只更新那部分而不是整个页面?
您可以尝试在您的页面中使用 setTimeout javascript 计时器并为其提供 ajax 函数,该函数将为您加载部分内容。这是超时函数原型:
<script type='text/javascrit'> function loadPartial() { //your ajax call } $(document).ready(function () { setTimeout("loadPartial",30000); }); </script>