mvc3如何在对话框关闭时重定向

时间:2014-11-18 06:48:43

标签: jquery asp.net-mvc-3 dialog

我有一个表单对话框,当提交时,对话框会根据需要关闭,但我想重定向原始的非对话框页面。这可以让我更清楚我在关闭对话框时打开第1页上的对话框我想自动重定向到第2页,这是我的代码。

    buttons:
                {
                    "Post": function () {
                       // This submits the form
                        var postedcity = $("#postedcity").val();
                        $.post('@Url.Action("newthread","Account")', {city:postedcity});
                        $(this).dialog("close");
                       // This closes the dialog box and now I would like to redirect to
                       // page 2 which is non dialoged and pass the parameter postedcity
                       // The controller path is Home/page2
                    }

 This is the action method I am trying to redirect to

Public ActionResult page2(string postedcity)
{

}

0 个答案:

没有答案