I need to have a URL in the following format:
nomedosite.com/note/ {anything)
I need this url to fire the controller Note
, with the action Index
. How do I set up my route?
I tried to use this:
routes.MapRoute(
name: "OpenNote",
url: "{controller}/{*stringNote}",
defaults: new { controller = "Note", action = "Index", stringNote = UrlParameter.Optional }
);
But I always get page 404, that is, it's not working the way I want it to be. How do I set up my route?