vecsuresh
vecsuresh

Reputation:

How can I change the default action method inside the ActionInvokeMethod of the ControllerActionInvoker class?

How can I change the default action method inside the ActionInvokeMethod of the ControllerActionInvoker class?

Upvotes: 0

Views: 137

Answers (1)

CubanX
CubanX

Reputation: 5252

This is not controlled in that function. This comes from your RouteTable.

For example:

routeCollection.MapRoute(null, "{controller}/{action}/{id}", new {action = "Index", id = (string) null}, new {controller = @"[^\.]*"});

Note there that the anonymous object has action = "Index"

This tells the routing engine that if action does not exist, set it's value to "Index".

This is probably the very route you want to modify in your RouteTable. If I changed this in my app to "SomeOtherAction" that would be the default action that would fire.

Hope this helps...

Upvotes: 2

Related Questions