views:

38

answers:

1

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?

+3  A: 

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

BalusC
@Balusc there is no value `{"redirectUrl":"/"`
Pandiya Chendur
Then you need to fix `json.redirectUrl` to `data.redirectUrl`.
BalusC
@Balusc ya just did that got it working...
Pandiya Chendur