4
我想使用標準的AuthorizeAttribute(即不是繼承它),但使用自定義重定向。那可能嗎?我應該在哪裏檢查401並重定向?AuthorizeAttribute with custom redirect
我試圖添加
<customErrors mode="On" >
<error statusCode="401" redirect="/Errors/NotAuthorized/" />
</customErrors>
,但沒有奏效。
我試圖做一些類似Global.asax的事情,但似乎我沒有訪問AuthorizationContext那裏... – TDaver 2011-05-09 08:19:13