2
I need to have a URL in the following format:
nomedosite.com/note/{anything}
I need this URL to trigger the controller Note
, with the action Index
. How should I set 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, IE, it is not working as I want. How should I configure my route?
That one anything is going to be a string passed? because it has a asterisk?
– Barbetta
yes it is a string, it has asterisk because it was in the tutorial that followed, but I tried it without it and also did not give
– ihavenokia