jquert警告消息框重定向后单击确定 [英] jquert alert message box redirect upon click ok

查看:128
本文介绍了jquert警告消息框重定向后单击确定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用模型视图控制器4,让我怎么重定向在点击消息框中单击确定回到索引页?

i am using ModelView Controller 4 , so how do i redirect the message box upon click ok back to index page?

我的继承人code

    <script type="text/javascript">
    $(function errMsgBox() {
        alert("Please select the Correct Activity and Task");           
       @Html.ActionLink("Back to List", "/Index") 
    });

推荐答案

您不需要在这里使用的剃须刀了。只需使用window.location的对象。

You don't need to use razor here anymore. Just use the window.location object.

<script type="text/javascript">
    $(function errMsgBox() {
        alert("Please select the Correct Activity and Task");
        window.location = "/Home/Index";
    });
</script>

这篇关于jquert警告消息框重定向后单击确定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆