In my AccountController class I have the following:
public ActionResult Verification(string userGuid)
{
Debug.WriteLine(userGuid);
...
In my global.asax I have:
routes.MapRoute(
"AccountVerification",
"{controller}/{action}/{userGuid}",
new { controller = "Account", action = "Verification", userGuid = UrlParameter.Optional }
);
When I go to http://localhost/Account/Verification/123 ... theres no debug output... its not recognizing the parameter - which is my problem. Not sure what I'm missing.
I do want this parameter to be optional... if its not set then I return a different view.
Edit:
When I place a Debug.WriteLine("hello world");
in the Verification function, it does output it so the routing appears to go to the correct function.
Edit Again: The default controller is still present but I wouldn't think it would hit that route since it uses a different controller / action
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);