Page not found error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi

Although I correctly define the routing settings and controller settings, it does not go to the page I want.

I am getting the page not found error

Why wrong with you?


====> Controller


  [HttpPost]
        public virtual ActionResult UrunHatasiBildirActionName(int productId)
        {
            var product = _productService.GetProductById(productId);
            if (product == null || product.Deleted || !product.Published)
                return RedirectToRoute("HomePage");

            var model = new UrunHatasiBildirModel();

            return View("~/Plugins/Widgets.UrunHatasiBildir/Views/UrunHatasiBildirActionName.cshtml", model);
        }

        [HttpPost]
        public virtual ActionResult UrunHatasiBildirActionName(UrunHatasiBildirModel model)
        {                      
            var product = _productService.GetProductById(model.UrunId);
            if (product == null || product.Deleted || !product.Published)
            {
                return RedirectToRoute("HomePage");
            }

            return View("~/Plugins/Widgets.UrunHatasiBildir/Views/UrunHatasiBildirActionName.cshtml", model);
        }

        [HttpPost]
        [ChildActionOnly]
        public ActionResult PublicInfo(string widgetZone, object additionalData = null)
        {
            return View("~/Plugins/Widgets.UrunHatasiBildir/Views/PublicInfo.cshtml", null);
        }




===========>>>> RouteConfig

public partial class RouteConfig : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            
            routes.MapRoute("UrunHatasiBildirAction", "UrunHatasiBildir/UrunHatasiBildirActionName/{productId}",
                           new { controller = "UrunHatasiBildir", action = "UrunHatasiBildirActionName" },
                           new { productId = @"\d+" },
                           new[] { "Nop.Plugin.Widgets.UrunHatasiBildir.Controllers" });

        }

        public int Priority
        {
            get { return 0; }
        }
    }



Views Page Name : UrunHatasiBildirActionName.cshtml

Page 2 name : PublicInfo.cshtml



I am debugging. It never enters the controller method
5 years ago
Hi, did you find a solution? I'm having the same issue now
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.