Select from following answers:- Action methods cannot be overloaded
- Action methods must be public
- Action methods cannot be private or protected
- Action methods cannot be a static method
- All Above

In the Controller of a typical ASP.NET MVC Application, all the public methods of a Controller class are called Action methods. They behaves as public functions and has the below constraints -
a) Action methods cannot be private or protected.
b) Action methods cannot be overloaded
c) Action methods cannot be a static method.
e.g.
public class TestController:Controller {
public ActionResult MyActionMethod {
return View("Hello World");
}
}
In the example,
MyActionMethod is the Action method of the TestController class. And it is of type public.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator