错误如:未找到视图"LoginRegister"或其主控或没有视图引擎支持搜索的位置.搜索了以下位置:
〜/查看/我的帐户/ LoginRegister.aspx
〜/查看/我的帐户/ LoginRegister.ascx
〜/查看/共享/ LoginRegister.aspx
〜/查看/共享/ LoginRegister.ascx
〜/查看/我的帐户/ LoginRegister.cshtml
〜/查看/我的帐户/ LoginRegister.vbhtml
〜/查看/共享/ LoginRegister.cshtml
〜/查看/共享/ LoginRegister.vbhtml
实际上我的页面浏览页面就是 ~/Views/home/LoginRegister.cshtml我所做的
而我的RouteConfig是
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "MyAccount", action = "LoginRegister", id = UrlParameter.Optional }
);
}
}
Run Code Online (Sandbox Code Playgroud)