asp.net mvc 4 - Error page not being used on exception -
asp.net mvc 4 - Error page not being used on exception -
when exception thrown on mvc4 (.net) application, error page shown.
my web.config file has
<system.web>         <customerrors mode="on"  defaultredirect="~/error/" />     <compilation debug="true" targetframework="4.5"  /> </system.web>    but, in controller page, diving 0 (to test it). naturally, exception thrown not redirect me error controller. instead, page shows:
sorry, error occurred while processing request.
my errorcontroller is:
public actionresult index() {           homecoming view();  }    and routes are
    public static void registerroutes(routecollection routes)     {         routes.ignoreroute("{resource}.axd/{*pathinfo}");          routes.maproute(             name: "default",             url: "{controller}/{action}/{id}",             defaults: new { controller = "home", action = "index", id = urlparameter.optional }         );     }    and view empty:
@{     viewbag.title = "there fault."; }    a online shows web.config, mine appear correct.
i understand message if error controller or error view had faults!
please note, have used customerrors mvc many times before, on same server, i'm lost why occurring.
what should doing?
 asp.net-mvc-4 
 
Comments
Post a Comment