ASP.net MVC 5 by Jordan Rees

ASP.net MVC 5 by Jordan Rees

Author:Jordan Rees [Rees, Jordan]
Language: eng
Format: azw3
Published: 2017-04-02T04:00:00+00:00


Register Filters

There are three levels in which filters can be applied:

Global Level

Filters may be applied at the global level in the Application_Start event of the file Global.asax.cs using the default FilterConfig.RegisterGlobalFilters() method. The example given below shows the [HandleError] that is used by default in all MVC applications:

// MvcApplication class is in the Global.asax.cs file

public class MvcApplication : System.Web.HttpApplication

{

protected void Application_Start()

{

FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

}

}

// FilterConfig.cs located in App_Start folder

public class FilterConfig

{

public static void RegisterGlobalFilters(GlobalFilterCollection filters)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.