从ajax内部发布后重定向到页面 [英] Redirecting to a page after post from within ajax

查看:51
本文介绍了从ajax内部发布后重定向到页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从ajax发布后重定向到操作索引,控制器Admin.

I want to redirect to the action Index, controller Admin after the post from ajax.

$.post("/Admin/Create", { inputs: inputs, columnsCount: columnsCount, });

成功后,如何更改此代码以将其重定向到索引页?

How can I change this code to redirect it to the index page after success?

推荐答案

使用 post

$.post(
    "/Admin/Create", 
    { inputs: inputs, columnsCount: columnsCount, },
    function() {
        window.location.replace("/Admin/index");
    }
);

这篇关于从ajax内部发布后重定向到页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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