C# mvc3不接受正确的URL?

C# mvc3不接受正确的URL?,c#,asp.net-mvc,asp.net-mvc-3,razor,C#,Asp.net Mvc,Asp.net Mvc 3,Razor,我有一个名为“TafelController.cs”的控制器和一个名为“Berekenen.cshtml”的视图。(这些名字不是我编的。) url“”在某种程度上不起作用,即使在向berekenen添加扩展名时,如“.cshtml”。 将控制器和视图的名称去掉头像也不起作用。 问题是,当我将Index()方法设置为以下形式时,我得到了正确的视图 public ActionResult Index() { return View("berekenen"); } 这很奇怪,因为这就是 ht

我有一个名为“TafelController.cs”的控制器和一个名为“Berekenen.cshtml”的视图。(这些名字不是我编的。)

url“”在某种程度上不起作用,即使在向berekenen添加扩展名时,如“.cshtml”。 将控制器和视图的名称去掉头像也不起作用。 问题是,当我将Index()方法设置为以下形式时,我得到了正确的视图

public ActionResult Index()
{
    return View("berekenen");
}
这很奇怪,因为这就是

http://localhost:portnum/tafel/berekenen
是。 将该页面设置为起始页面时,URL略有不同。 然后就变成了

http://localhost:5181/Views/tafel/berekenen.cshtml

有人知道会发生什么吗?

http://localhost:portnum/tafel/berekenen
正在尝试导航到
TafelController
上名为
Berekenen
的方法。您需要添加以下方法

public ActionResult Berekenen()
{
    return View();
}

控制器需要一个方法
public ActionResult Berekenen(){return View();}
来解决这个问题。非常感谢。现在的问题是,如何将注释标记为awnserI(我将很快添加一条:)