
Hi,
Action Filter is an attribute which implements
FilterAttribute class. ActionFilters in MVC are HandleError, OutputCache, ValidateInput, Authorize, ValidateAntyForgeryToken. Every one has its own functionality.
Implementation: This is how to implement Action Filters,
[HandleError]
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Welcome to MVC";
return View();
}
public ActionResult About()
{
return View();
}
}
Hope this helps you.
Thanks & Regards,
Krishna
KASANI007, if this helps please login to Mark As Answer. | Alert Moderator