码迷,mamicode.com
首页 > Web开发 > 详细

MVC 重定向 并且弹出提示信息

时间:2015-04-26 19:42:32      阅读:402      评论:0      收藏:0      [点我收藏+]

标签:

在控制器中使用Redirect或者使用RedirectToAction重定向视图,需要弹出提示框情况下是加一个中间单独的跳转页,在跳转页里面弹出提示。实例:

 

视图代码:

<a role="button" class="btn green" id="judgeAdd" onclick="showJudge_modal()"
                    data-toggle="modal">预约</a>
<script>
    function showJudge_modal() {
   var url = "/Home/JudgeAppoint";
                $("#judgeAdd").attr("href", encodeURI(url));
}
</script>
   控制器代码:
public ActionResult Index() { return View(); }

public ActionResult JudgeAppoint() { return View(); }
   public ActionResult AddJudgeAppoint()
        {
 return Redirect("rjudge");
}

 public ActionResult rjudge()
        {

            return Content("<script>alert(‘12121‘);location.href=‘/Home/JudgeAppoint‘</script>");
        }

 

MVC 重定向 并且弹出提示信息

标签:

原文地址:http://www.cnblogs.com/JD-XIAOMEI/p/4458119.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!