Source

main-vinayFork / Source / WebClient / Web.Client / Infrastructure / ButtonAttribute.cs

Full commit
using System.Web.Mvc;

namespace Microsoft.Research.Dcxl.Web.Client.Infrastructure
{
    public class ButtonAttribute : ActionMethodSelectorAttribute
    {
        public string ButtonName { get; set; }

        public override bool IsValidForRequest(ControllerContext controllerContext, System.Reflection.MethodInfo methodInfo)
        {
            return controllerContext.Controller.ValueProvider.GetValue(ButtonName) != null;
        }
    }
}