Copied to clipboard

Flag this post as spam?

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


  • Niker 16 posts 86 karma points
    18 days ago
    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 16 posts 86 karma points
    18 days ago
    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