开发者

json returned from a jsonresult in asp.net mvc

开发者 https://www.devze.com 2022-12-30 19:44 出处:网络
I am returning this from a json result from a controller, var genericResult = new { redirectUrl = Url.Action(\"Create\", \"Registration\")

I am returning this from a json result from a controller,

 var genericResult = new { redirectUrl = Url.Action("Create", "Registration")
                                , isRedirect = true };
return Json(genericResult);

but when i inspect through firebug,

{"redirectUrl":"/","开发者_如何转开发isRedirect":true}

       if (data.isRedirect) {
            window.location.href = json.redirectUrl;
        }

Any suggestion.... How to redirect?


Depending on how it's been declared, either fix data to json, or fix json to data.

0

精彩评论

暂无评论...
验证码 换一张
取 消