如何重定向整个页面,而不是仅更改部分视图? [英] How to redirect full page rather then only partial view changing?

查看:168
本文介绍了如何重定向整个页面,而不是仅更改部分视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的情况是,我在一个名为客户"的控制器上,并且有一个使用客户编号作为标识符调用的帐户方法.

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.

然后我有一个ActionLink,将我带到欠款索引的部分视图中的任务表中,以拖欠任务.加载此文件时,我会存储Request.ServerVariables["http_referer"],以便可以使用它返回.

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.

当我随后将Return Redirect()与引荐来源一起使用时,它会进行重定向,但会像在iframe中加载一样加载到部分区域中.

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?

推荐答案

使用以下返回结果作为ActionResult返回值会中断AJAX调用并重定向整个页面

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

这篇关于如何重定向整个页面,而不是仅更改部分视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆