Graham
Graham

Reputation: 47

How to redirect full page rather then only partial view changing?

I have a situation where I am on a controller called customer, and I have an account method which I called using a customer number as the identifier.

I then have an ActionLink that takes me to Arrears task with the task form in a partial view of arrears index. on loading this I store the Request.ServerVariables["http_referer"] so I can use that to return.

When I then use Return Redirect() with the referrer it does the redirect but loads in the partial section like it was loading in an iframe.

Can anyone point me to how to redirect the whole page and not only the partial?

Upvotes: 0

Views: 4010

Answers (2)

Graham
Graham

Reputation: 47

using the following return for the ActionResult return breaks out of the AJAX call and redirects the entire page

    return JavaScript("window.location = 'your specified url'");

Upvotes: 1

Gjohn
Gjohn

Reputation: 1281

Try redirecting to a particular action which will return the the View you want

return RedirectToAction("Index", model);

Upvotes: 1

Related Questions