MVC控制器弹出提示,并跳回当前界面
- 方法①、
public ActionResult add()
{
return Content("<script>alert('添加成功!');location.href='/lxtz/Index'</script>");
}
- 方法②、
public ActionResult add()
{
return Content("<script>alert('添加成功!');history.go(-1);</script>");
}
运行显示效果
点击”添加“按钮[弹出提示内容,并跳转到当前界面]
温馨提示:
喜欢灰碟分享的小伙伴不要忘记关注噢~这样子,想找我时就不会迷路啦*
联系方式:
Vx+:LHD7575