0

this url working fine http://localhost:64333/get/5/6/1

but this url not working http://localhost:64333/get/5/6/index-1.shtml show 404 page not found

   routes.MapRoute(
                 "OnlyAction",
                "{action}/{id}/{sub_id}/{page_no}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional, sub_id = UrlParameter.Optional, page_no = UrlParameter.Optional }
                ); 
 routes.MapRoute(
               name: "Idpages",
               url: "{action}/{id}/index-{page_no}.shtml",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, sub_id = UrlParameter.Optional, page_no = UrlParameter.Optional }
                );
            routes.MapRoute(
              name: "subIdPages",
              url:   "{action}/{id}/{sub_id}/index-{page_no}.shtml",
               defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, sub_id = UrlParameter.Optional, page_no = UrlParameter.Optional }
                ); 
  • If you want to MapRoute to a html file, you could refer to the first answer in the link [C# .net MapRoute to html file](https://stackoverflow.com/questions/48469487/c-sharp-net-maproute-to-html-file) – Jack J Jun - MSFT Jul 05 '21 at 06:38

0 Answers0