내 컨트롤러에서 반환하려면 액세스 거부 ActinoResult 만들려고합니다. 나는ASP.Net MVC 3 ActionResult 경로로 리디렉션하는 방법
public class AccessDeniedResult : ActionResult
{
public override void ExecuteResult(ControllerContext context)
{
if (null != context && null != context.HttpContext && null != context.HttpContext.Response)
{
context.HttpContext.Response.StatusCode = 401;
context.HttpContext.Response.RedirectToRoute("AccessDenied");
}
}
}
이 때문에 HttpResponseBase에서 오는 NotImplementedException 작동하지 않습니다이 context.HttpContext.Response로 전달되는 다음과 같은 구현을 가지고있다.
어떻게하면 MVC3에서 올바른 리디렉션 작업 결과를 작성합니까?
http://msdn.microsoft.com/en-us/library/system.web.httpresponsewrapper.redirecttoroute.aspx에 대한 의견은 있지만 해결책은 없습니다. – Jason