我有这个问题。我使用参数“ topic”创建了“ Topic”操作,但是当我转到“ About / Topic?topic = aloha”时,找不到此操作,并且出现错误:“找不到页面 没有umbraco文档与url'/ About / Topic?主题=喂”。 “
控制器:
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 }
);
}