我简单的Web应用程序与1个默认路由:ASP.NET MVC默认劳斯是错误的
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Game", action = "Index", id = UrlParameter.Optional }
);
我控制器包含以下操作:
public class GameController : Controller
{
public ActionResult Index()
{
// some actions
return View();
}
[HttpPost]
public ActionResult CreateGame(Game game, User user)
{
// some actions
return View("Game");
}
[HttpPost]
public ActionResult JoinGame(User user)
{
// some actions
return View("Game");
}
}
此外,根据查看/ GAME文件夹我“索引”和“游戏”视图。 但是,当我从时间开始应用时间(不总是!),它要求
http://localhost:55815/Game/Game
,而不是
http://localhost:55815 or http://localhost:55815/Game/Index
好吧,我在脑海里有一件事 - OMG!严重!我调试了几个小时! &%$#^ @ $#$#*%$(^(^%... grrrrr 非常感谢! – 2015-04-03 13:51:20