I am developing a dashboard with rendering different KPI's. There is also an interaction with a tool, that's why I have chosen MVC.
Now I have a layout page with a navigation bar. In the Navigation bar I am linking with @Url.Action. So far so good. Every page is working, and if a link is done where exists an other Controller, it works, too. Only in one link I have a problem - I get always the "resource not found" errorpage.
The page LockedOrder is not working.
My layout view looks like this:
<ul class="treeview-menu">
<li>
<a href="@Url.Action("Index", "Home")"><i class="fa fa-circle-o text-yellow"></i>Lab Dashboard<i class="fa fa-angle-left pull-right"></i></a>
<ul class="treeview-menu">
<li><a href="@Url.Action("Index", "Home")"><i class="fa fa-circle-o"></i>Home</a></li>
<li><a href="@Url.Action("Load" , "LockedOrder")"><i class="fa fa-circle-o"></i>Locked Order</a></li>
</ul>
</li>
<li><a href="@Url.Action("Index","DashboardXY" )"><i class="fa fa-circle-o text-blue"></i>DashboardXY</a></li>
</ul>
Here is my LockedOrder Controller:
public class LockedOrderController : Controller
{
List<string> table = new List<string>();
// GET: LockedOrder
public ActionResult Load()
{
table = LoadTable(table);
return View();
}
}
A view Load.cshtml exists on the correct view folder.
My RouteConfig file:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// Locked Order
routes.MapRoute(
name: "LockedOrder",
url: "LockedOrder/{Load}/{id}",
defaults: new { controller = "LockedOrder", action = "Load" }
);
// Dashboard Resources Department Route
routes.MapRoute(
name: "DashboardXY",
url: "dashboard/{ departmentchooser}",
defaults: new { controller = "DashboardXY", action = "depchooser" }
);
routes.MapRoute(
name: "Default",
url: "Home/{action}/{id}",
defaults: new { controller = "Home", action = "Index" }
);
}
So why are all links working and only the link of LockedOrder not?
Please help me. I'm really new in ASP.Net MVC, so if something is not clear, just ask me :)
Thanks!
Update: This is my errormessage which I get (I'm sorry, its in German, but may be it can help you to help me :) )
Update 2 Now my code looks like this: RouteConfig LockedOrderController