For a project I've to(unfortunately) match some exact url.
So I thought it will not be a problem, I can use the "MapRoute", to match urls with the desired controller. But I can't make it work.
I've to map this URL:
http://{Host}/opc/public-documents/index.html
to
Area: opc
Controller: Documents
Action: Index
Another example is to map
http://{Host}/opc/public-documents/{year}/index.html
to
Area: opc
Controller: Documents
Action:DisplayByYear
Year(Parameter): {year}
I tried this, whitout success, in my area(ocpAreaRegistration.cs):
context.MapRoute("DocumentsIndex", "opc/public-documents/index.html",
new {area="opc", controller = "Documents", action = "Index"});
context.MapRoute("DocumentsDisplayByYear", "opc/public-documents/{year}/index.html",
new {area="opc", controller = "Documents", action = "Action:DisplayByYear"});
But I got some 404 Errors :( when I'm trying to access it. What am I doing wrong?
RegisterRoutesin global.asax.cs