I am working on a deal website and have defined the following route in the global.asax.
routes.MapRoute(
"AboutFooter",
"about-bicker-shop",
new { controller = "Footer", action = "About" }
);
routes.MapRoute(
"ContactFooter",
"contact-bickershop",
new { controller = "Footer", action = "Contact" }
);
routes.MapRoute(
"PrivacyPolicyFooter",
"privacy-policy",
new { controller = "Footer", action = "PrivacyPolicy" }
);
routes.MapRoute(
"TermsAndConditionsFooter",
"terms-and-conditions",
new { controller = "Footer", action = "TermsAndConditions" }
);
routes.MapRoute(
"SiteMapFooter",
"sitemap",
new { controller = "Footer", action = "SiteMap" }
);
routes.MapRoute(
"FAQFooter",
"faq",
new { controller = "Footer", action = "FAQ" }
);
routes.MapRoute(
"UnsubscribeFooter",
"unsubscribe",
new { controller = "Footer", action = "Unsubscribe" }
);
routes.MapRoute(
"GetDealsByCity",
"daily-bickers/{cityName}",
new { controller = "Home", action = "Home" }
);
routes.MapRoute(
"GetDealsbyCategory",
"daily-bickers/{cityname}/{category}",
new { controller = "Home", action = "GetDealsByCategory" }
);
routes.MapRoute(
"GetDealDetails",
"{cityName}/{dealName}",
new { controller = "Home", action = "GetDealsByDealName" }
);
routes.MapRoute(
"DealCheckout",
"{cityName}/{dealName}/checkout",
new { controller = "Home", action = "CheckoutDealByDealName" }
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
It works fine till the time I am viewing the details of the deal but I am getting an error when I click on the buy button to buy the deal.
On further research I found that on clicking the buy button, the code is invoking the GetDealsByDealName action and not the action CheckoutDealByDealName. Please suggest me the solution.