如何在MVC中点击按钮点击页面 [英] How to refersh page on button click in MVC
本文介绍了如何在MVC中点击按钮点击页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
要刷新当前记录(刷新将使用空白页刷新此页面,因此用户可以创建新记录或搜索其他记录)。
我的尝试:
To refresh the current record (refreshing will refresh this page with a blank page, so the user can either create a new record OR search for another record).
What I have tried:
$(document).ready(function () {
$('#RefreshPage').click(function () {
location.reload();
});
});
<input type="submit" id="RefreshPage" class="btn btn-primary" value="Refresh" name="Command"/>
推荐答案
(document).ready(function(){
(document).ready(function () {
( '#RefreshPage')。点击(function(){
location.reload();
});
});
('#RefreshPage').click(function () { location.reload(); }); });
<input type="submit" id="RefreshPage" class="btn btn-primary" value="Refresh" name="Command"/>
试试这个:
Try this:
window.location.reload();
这篇关于如何在MVC中点击按钮点击页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文