Is it possible to have a slash in the ActionName attribute in ASP MVC?

e.g. I would like a paths


The reason for this is it mimics the navigation a user would use. But if I try to add the following to MyController it doesn't work.

public ActionResults A() {...}

Obviously without the attribute it wouldn't work either.

I've tried changing my RouteConfig.cs to

    name: "MyController",
    url: "MyController/MyAction2/{action}",
    defaults: new { controller = "MyController", action = "Index" }

But this affects all MyController paths. How can I get either a slash in the action name, or have the route config 'override' only come in to play when the action is MyAction2?

Related posts

Recent Viewed