zoukankan      html  css  js  c++  java
  • The view or its master was not found or no view engine supports the searched locations

    Error like:The view 'LoginRegister' or its master was not found or no view engine supports the searched locations. The following locations were searched:

    ~/Views/MyAccount/LoginRegister.aspx

    ~/Views/MyAccount/LoginRegister.ascx

    ~/Views/Shared/LoginRegister.aspx

    ~/Views/Shared/LoginRegister.ascx

    ~/Views/MyAccount/LoginRegister.cshtml

    ~/Views/MyAccount/LoginRegister.vbhtml

    ~/Views/Shared/LoginRegister.cshtml

    ~/Views/Shared/LoginRegister.vbhtml

    Actually my page view page is ~/Views/home/LoginRegister.cshtml so what i do

    and my RouteConfig is

     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 }
                );
            }
        }

    第一种方法:

    public ActionResult LoginRegiseter()
    {
      return View("LoginRegiseter");
    }

    第二种方法:

    public ActionResult LoginRegiseter()
    {
      return View("~/Views/MyAccount/LoginRegiseter.cshtml");
    }

  • 相关阅读:
    几个概率题
    几个智力题。。
    [算法]各种二分查找
    深入 JavaScript 时间对象 Date
    Leaflet 调用百度瓦片地图服务
    JavaScript中进制和字符编码问题
    DOM事件流
    flex 弹性布局
    javascript 闭包内部机制
    HTML DOM setAttribute()、与createAttribute()
  • 原文地址:https://www.cnblogs.com/googlegis/p/12065826.html
Copyright © 2011-2022 走看看