我需要从 Home.cshtml 链接到 Login.cshtml 页面,但它似乎找不到链接。
主页.cshtml
@{
Layout = "~/Shared/Master.cshtml";
ViewBag.Title = "Home";
}
@section menu
{
<a href="/Login">Login</a>
}
家庭控制器.cs
public class HomeController : Controller
{
//
// GET: /Home/Home
public ActionResult Home()
{
return View();
}
//
// GET: /Home/Login
public ActionResult Login()
{
return View();
}
}
路由配置
routes.MapRoute(
name: "Default",
url: "",
defaults: new { controller = "Home", action = "Home" }
);
项目结构: