【发布时间】:2011-09-26 10:45:51
【问题描述】:
考虑控制器中的以下代码:
protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
{
if (!this.IsAuthorized)
{
filterContext.Result = RedirectToAction("Index", "Home", new { area = "" });
//filterContext.Result = Redirect(Url.Content("~/Home/Index")); // Gives same result as the previous row
return;
}
base.OnActionExecuting(filterContext);
}
如果我在未经授权的情况下输入以下网址:
somecontroller/someaction#/?tab=Foo
我被重定向到:
/Home/Index#/?tab=Foo
为什么没有从 url 中删除哈希?
我怎样才能在服务器端摆脱它?
【问题讨论】:
标签: c# asp.net asp.net-mvc redirect