Consider the following code within a controller:
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);
}
If I enter the follwing url when not authorized:
somecontroller/someaction#/?tab=Foo
I get redirected to:
/Home/Index#/?tab=Foo
How come the hash isn't stripped from the url?
How can I get rid of it serverside?