A route named 'MyCatalog' could not be found in the route collection. Parameter name: name Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: A route named 'MyCatalog' could not be found in the route collection.
You need to change the href="@Url.RouteUrl("MyCatalog")" to your page's url (for example: href="/yourpage" or href="http://www.yourwebsite.com/yourpage")...
My bad :) Didn't see on the other post that you've created a controller for this (thought you've created a "topic" page)...
I am currently writing a menu editor (will share when done):
public class MenuItem : BaseEntity { private ICollection<MenuItem> _menuItems;
public virtual string Title { get; set; } public virtual string Slug { get; set; } public virtual string LinkTitle { get; set; } public virtual string SubText { get; set; } public virtual string MimeType { get; set; } public virtual byte[] BinaryData { get; set; } public virtual string IconAltTag { get; set; } public virtual string IconTitle { get; set; } public virtual int ParentItemId { get; set; } public virtual int DisplayOrder { get; set; } public virtual DateTime? PublishFrom { get; set; } public virtual DateTime? PublishTo { get; set; } public virtual int LanguageId { get; set; }
public virtual Language Language { get; set; } public virtual MenuItem ParentItem { get; set; } public virtual ICollection<MenuItem> ChildItems { get { return _menuItems ?? (_menuItems = new List<MenuItem>()); } protected set { _menuItems = value; } } }
1) Edit the RouteProvider.cs file in Nop.Web project 2) Add the following code:
routes.MapRoute("MyCatalog", "MyCatalog" or whatever your route is, new { controller = "MyCatalog", action = "Index (or whatever the name or your action is)", any additional parameter if needed }, new[] { "Nop.Web.Controllers" }); 3) Compile