1.

Can we overload the action methods?

Answer»

It is possible to overload the action methods by passing the NAME of the method in the ActionName ATTRIBUTE as given below:

[ActionName("ActionMethodExample")]public ActionResult getInfo(INT id){ return "";}

Another action method with the same name can be declared as given below:

public ActionResult getInfo(){ return "";}

Now, these two getInfo() methods can be overloaded as they are having the same FUNCTION name but DIFFER in the number of arguments.



Discussion

No Comment Found