top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to change the action name in ASP.Net MVC?

0 votes
737 views
How to change the action name in ASP.Net MVC?
posted Aug 23, 2016 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

"ActionName" attribute can be used for changing the action name. Below is the sample code snippet to demonstrate more :

[ActionName("TestActionNew")]
public ActionResult TestAction()
    {
        return View();
    }

So in the above code snippet "TestAction" is the original action name and in "ActionName" attribute, name - "TestActionNew" is given. So the caller of this action method will use the name "TestActionNew" to call this action.

answer Aug 23, 2016 by Shivaranjini
...