Skip to content
A simple demonstration of how to create action filter atttibutes
Branch: master
Clone or download
Babis Karypidis
Latest commit a685d70 Nov 5, 2014
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add check for not logged in users in the filter attribute Nov 1, 2014
ActionFilters.sln Initial project creation Oct 31, 2014


This project includes two action filter attributes that can be used to decorate controller classes or controller actions to ensure that the currently logged in user has verified the email address based on the new ASP.NET Identity system.


MVC controller action. It can be used on a class level as well.

public class HomeController : Controller {
	public ActionResult Contact() {
		ViewBag.Message = "Your contact page.";
		return View();

Web Api controller class. It can be used on individual controller actions as well.

public class ExampleController : ApiController {
	// GET: api/Example
	public IEnumerable<string> Get() {
		return new string[] { "value1", "value2" };
You can’t perform that action at this time.