Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Niker 21 posts 91 karma points
    Jun 08, 2019 @ 11:02
    Niker
    0

    Umbraco action with parmeter error: “Page not found No umbraco document matches the url '/About/Topic?topic=aloha'.”

    I have this problem. I created the "Topic" action with the parameter "topic" but when I go to "About / Topic? topic = aloha" I can not find this action and I get an error: "Page not found No umbraco document matches the url '/ About / Topic? Topic = aloha'. "

    Controller:

    public class AboutController : Umbraco.Web.Mvc.RenderMvcController
    {
        // GET: About
        public ActionResult About(RenderModel model)
        {
            return View("About", model);
        }
    
        public ActionResult Topic( string topic)
        {
            return View("About");
        }
    }
    

    Routing:

    public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
            name: "Default1",
            url: "{controller}/{action}/{topic}",
            defaults: new { controller = "About", action = "Topic", topic = UrlParameter.Optional }
            );
        }
    
  • Niker 21 posts 91 karma points
    Jun 09, 2019 @ 09:24
    Niker
    0

    The controller's actions had to be changed on

        public ActionResult About(RenderModel model , string topic)
        {
            return View("About", model);
        }
    

    and called /About?topic=aloha

Please Sign in or register to post replies

Write your reply to:

Draft