My mind is somehow blank. How do I do this:
I have a RegistrationController
and want the URL /register
to hit the action Register
on that controller. What do I have to add as a map route in global.asax?
My mind is somehow blank. How do I do this:
I have a RegistrationController
and want the URL /register
to hit the action Register
on that controller. What do I have to add as a map route in global.asax?
routes.MapRoute(
"MyCustomRoute", // Route name
"Registration/Register", // URL with parameters
new { controller = "Registration", action = "Register" } // Parameter defaults
);
Actually, what you want is this:
routes.MapRoute(
"RegisterRoute",
"Register",
new { controller = "Registration", action = "Register" }
);
Now you can go to your page with an url like: