Custom Error Page on Asp.net MVC

under Global.asax

        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

this method to handle the Error.

and in Web.debug.config file, we have

      <customErrors defaultRedirect="GenericError.htm"
        mode="RemoteOnly" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>

to handle the Error corresponsive.

posted @ 2013-01-23 12:29  MC_ED  阅读(235)  评论(0编辑  收藏  举报