0

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?

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

there is no value {"redirectUrl":"/"
Then you need to fix json.redirectUrl to data.redirectUrl.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.