InterviewSolution
Saved Bookmarks
| 1. |
What is used to handle an error in MVC? |
|
Answer» Error handling is usually done USING Exception handling, whether it’s a Windows Forms application or a web application. The HandleError attribute is used, which helps in providing built-in exception filters. The HandleError attribute of ASP.NET can be functional over the action METHOD as well as Controller at its GLOBAL level. Example of implementation: PUBLIC static void RegGlobalFilters(Global_FilterCollection filt) { filt.Add(new HandleErrorAttribute());} protected void Application_Start() { AreaRegn.RegisterAllAreas(); RegGlobalFilters(Global_Filters.Filters); RegisterRoutes(Route_Table.Routes); } |
|