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");
}
相关文章
- MacOS安装Eclipse后启动报错:The JVM shared library "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/../lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol.
- Mysql 的异常:The last packet successfully received from the server was 90 milliseconds ago. The last packet sent successfully to the server was 43,603,303 milliseconds ago. is longer than the server con
- The Bug Hunters Methodology v3(ish)
- 记录一次在生成数据库服务器上出现The timeout period elapsed prior to completion of the operation or the server is not responding.和Exception has been thrown by the target of an invocation的解决办法
- On the Bias/Variance tradeoff in Machine Learning
- 【异常】[ERROR] The cloud assistant is not installed on the ECS, or the cloud assistant is unavailable. cloudassistant is uninstall
- mybatis报错Type interface xxx.Dao is not known to the MapperRegistry
- java错误:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Bu
- php时区设置 warning: strtotime(): It is not safe to rely on the system's timezone settings
- 2015 CALLED THE INTERFACE OF 2014
- The process could not execute 'sp_repldone/sp_replcounters' on 'ServerName'
- UVA 11300 Spreading the Wealth (数学推导 中位数)
- (纪录片)你必须知道的科学 The Science That You Have To Know (2014)
- [服务器时区问题]PHP Warning: strftime(): It is not safe to rely on the system's timezone set
- the exception "Failure to transfer org.apache.maven:maven-parent" about Maven
- [PWA] 17. Cache the photo
- 【收藏】HUE配置HDFS报错Cannot access: /. The HDFS REST service is not available. “ ““
- Unexpected XML declaration. The XML declaration must be the first node in the document and no white
- iOS 打包上传时报错its private key is not installed.to get a copy of the private key
- 成功解决MSB8020 The build tools for v141 (Platform Toolset = ‘v141‘) cannot be found. To build using the
- 【异常】Maven提示 repository element was not specified in the POM inside distributionManagement element
- 已解决Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
- EnvironmentNotWritableError: The current user does not have write permissions to the targe...
- HDU 2126 Buy the souvenirs
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Caused by: org.xml.sax.SAXParseException; systemId: file:/home/hadoop/hive-0.12.0/conf/hive-site.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well
- SharePoint Web Part Error – The Specified Solution Was Not Found
- Ubuntu,在VMware虚拟机下,开机时弹出:Could not apply the stored configuration for monitors
- git push报错 fatal: The current branch master has no upstream branch. To push the current
- 【异常】Flink整合ES出错,The implementation of the provided ElasticsearchSinkFunction is not serializable.