3
考虑一个控制器中下面的代码:从aspnet mvc中的重定向中清除哈希和参数?
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
怎么来的散列没有从网址中剥离?
我该如何摆脱它的serverside?
谢谢!优秀的链接。 :) –