I want an MVC app to have .aspx page URLs even though there will not be any physical aspx pages and I will be using the Razor view engine.
1) Is it possible to define such a route?
2) What would that route look like if I wanted a url such as, say, the one given below:
http://example.com/controller/action.aspx
and optionally
http://example.com/controller/action.aspx/id
and optionally
http://example.com/controller/action.aspx?queryParam1=value&queryParam2=value
(and so on...)
UPDATE
I realize I want URL's like this:
http://example.com/controller/id.aspx
In other words, I want no specific action to be specified. A default action will process all requests.
ANOTHER UPDATE
What I have specified in my route config is this:
routes.MapRoute(
name: "Default",
url: "{controller}/{id}.aspx",
defaults: new { controller = "Foo", action = "Index", id = "default" }
);
However, while the above route does work for Url's where Id is specified such as the ones below:
http://example.com/foo/bar.aspx
It does not work when no Id is specified, such as in the case below:
http://example.com/foo/