in my Global.ascx.cs, I have this parameter for routing:
routes.MapRoute(
"HomeTarget",
"{TargetCode}",
new { controller = "Home", action = "Index", TargetCode = "" });
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
In my HomeController, I have an Index () action like this:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Index(string TargetCode)
{
return View();
}
When I go to a site, for example, mysite.com/Test1, I believe that it should accept “Test1” as a TargetCode, but it does not ... What should I do to load it “Test1” as a TargetCode, I don’t want do this: mysite.com/?TargetCode=Test1
Thanks a lot, Kenny.
source
share