ASP MVC 后台控制器弹出框提示


提示框点击确定后页面变成空白页面

<span style="font-size:14px;">return Content("<script>alert('请先登录');</script>");</span>


提示框点击确定后页面变成你想要的页面(如实原页面怎会刷新一下)

<span style="font-size:14px;">return Content("<script>alert('请先登录');window.location.href='../home/index';</script>");</span>

接下来才是我所要讲的重点:提示框点击确定后页面返回原页面(不刷新,还保留页面用户输入的数据)

<span style="font-size:14px;">return Content("<script>alert('请先登录');<span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 24px; background-color: rgb(245, 245, 245);">history.go(-1);</span></script>");</span>

其实它的实质为后退一步历史记录。

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。