我有这个问题。我用参数" topic“创建了" Topic”操作,但是当我转到"About / Topic? Topic= aloha“时,我找不到这个操作,并得到一个错误:"Page not find No umbraco document与url '/ About / Topic? Topic= aloha‘匹配。”
控制器:
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");
}
}路由:
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 }
);
}https://stackoverflow.com/questions/56505728
复制相似问题