[RESOLVED]How to redirect to a normal non dialoged page after a dialog box closes

I have a form dialog box and when it is submitted the dialog box closes as need however I would like to redirect the original non-dialog page. This could make it more clear I open the dialog on Page 1 when that dialog box is closed I would like to automatically
redirect to page 2, this is my code.

                        "Post": function () {
                           // This submits the form
                            var postedcity = $("#postedcity").val();
                            $.post('@Url.Action("newthread","Account")', {city:postedcity});
                           // 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)




You can do that in the dialog box close event.


Checkout the jsfiddle below:


Hi castro305,

Thanks for your post.

You could use window.location to redirect the browser to a new page as below.

window.location("http://xxxxx/ Home/page2/" + postedcity);

For more information about window.location, you could refer to the following link.

Hope it will be helpful to you.

Best Regards,

Fei Han

Leave a Reply