0

I have a MVC.NET Web Application and would like to route to a controller and action without specifying the action. How do I do something like this:

mywebsite.com/MyController/{Id}
Adam
  • 497
  • 2
  • 9
  • 29
  • Define a custom route for it (with `url: MyController/{id}` and set the defaults to the controller name and action name) –  Mar 02 '18 at 21:35
  • You could handle the different id's that map to actions I would guess inside your one 'MyController' call. I would say that if you already know the Id maps to an action, then just use the Id as an action and don't try to go against the standard MVC routing patterns. – Adam Mar 02 '18 at 21:42
  • The id is a parameter, so I can't map the id to an action. – Adam Mar 02 '18 at 22:53

0 Answers0