我正在尝试将用户重定向到另一个website.domain。
这是控制器:
public void LogOff(){...}
我试过Server.Transfer("www.google.fr")
=>执行www.google.fr的子请求时出错。
我试过Redirect("www.google.fr");
=>没有页面加载
我不知道该怎么做......
答案 0 :(得分:2)
您可以使用return Redirect()
重定向到任何网址:
public ActionResult LogOff()
{
return Redirect("http://www.google.fr");
}
答案 1 :(得分:0)
System.Web.HttpContext.Current.Response.Redirect(" http://www.google.fr&#34);是解决我问题的有效方法!