using System; using System.Web.Mvc; namespace Web.Mvc { [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public sealed class MultipleButtonAttribute : ActionNameSelectorAttribute { public string MatchFormKey { get; set; } public string MatchFormValue { get; set; } public override bool IsValidName(ControllerContext controllerContext, string actionName, System.Reflection.MethodInfo methodInfo) { return controllerContext.HttpContext.Request[MatchFormKey] != null && controllerContext.HttpContext.Request[MatchFormKey] == MatchFormValue; } } }