Prevent Controller Method From Being Invoked

Controller in ASP.NET MVC is a class that inherits from the base class System.Web.Mvc.Controller. Any public method exposed by a controller is exposed as a controller action. If you want to prevent a public controller method from being invoked, you can put the "NonAction" attribute over the method name. By default Index() action is the default action that is invoked on a controller on when no explicit action is mentioned.