Wednesday, December 9, 2015

Marking Public Methods as Non-Action Methods

By default, the MVC framework treats all public methods of a controller class as action methods. If your controller class contains a public method and you do not want it to be an action method, you must mark that method with the NonActionAttribute attribute.
The following example shows a method that is marked with the NonAction attribute.
[NonAction]
private void DoSomething()
{
    // Method logic.
}

No comments:

Post a Comment