What is the use of ActionName Attribute in asp.net MVC?
What is the use of ActionName Attribute in asp.net MVC?
442
10-Mar-2022
Updated on 10-Mar-2022
Steilla Mitchel
10-Mar-2022[ActionName] Attribute :
In asp.net MVC [ActionName] attribte is an action selector which is used for providing different name to the action methods. When we want to call a action method using different name instead of its actual name then we use [ActionName] attribute. See the example below in which there is a action method original name 'Index',
In the above example if we need to call the action method Index then provide a correct way is - http://localhost:12345/home/home. If we use action method name Index instead of home then its throw 'server error in / Application'