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

。_饼干妹妹 提交于 2019-12-08 14:21:38

问题


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?


回答1:


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

return RedirectToAction("Index", model);



回答2:


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'");


来源:https://stackoverflow.com/questions/21541230/how-to-redirect-full-page-rather-then-only-partial-view-changing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!