zoukankan      html  css  js  c++  java
  • The view 'Index' or its master was not found.

    The view 'Index' or its master was not found.

    方案1

    Global.asax file contain the URL Route. Default URL route like this.

    "{controller}/{action}/{id}"

    So,Try this.

    1. Right click your controller method as below.

    Example: let say we call Index() method.Right click on it.

    2. Click Add View.. and give appropriate name.In this example name should be Index.

    Then it will add correct View by creating with relevant folder structure.

    方案2

    This error was raised because your Controller method name is not same as the View's name.

    If you right click on your controller method and select Go To View (Ctrl+M,Ctrl+G), it will either open a View (success) or complain that it couldn't find one (what you're seeing).

      1. Corresponding Controllers and View folders name have the same names.
      2. Corresponding Controller methods & Views pages should same have the same names.
      3. If your method name is different than view name, return view("viewName") in the method.

    2020-03-11 13:51:37,972 ERROR [9]: Message:The view 'Wizard' or its master was not found or no view engine supports the searched locations. The following locations were searched:
    ~/Views/Dashboard/Wizard.aspx
    ~/Views/Dashboard/Wizard.ascx
    ~/Views/Shared/Wizard.aspx
    ~/Views/Shared/Wizard.ascx
    ~/Views/Dashboard/Wizard.cshtml
    ~/Views/Dashboard/Wizard.vbhtml
    ~/Views/Shared/Wizard.cshtml
    ~/Views/Shared/Wizard.vbhtml
    LayerName:UserInterface
    StackTrace: at System.Web.Mvc.ViewResult.FindView(ControllerContext context)
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
    at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
    at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
    at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
    at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
    at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
    at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
    at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    complementaryMessage: controller:Dashboard, action:Wizard

    2020-03-11 13:48:46,776 ERROR [7]: Message:The view 'Logon' or its master was not found or no view engine supports the searched locations. The following locations were searched:
    ~/Views/Logon/Logon.aspx
    ~/Views/Logon/Logon.ascx
    ~/Views/Shared/Logon.aspx
    ~/Views/Shared/Logon.ascx
    ~/Views/Logon/Logon.cshtml
    ~/Views/Logon/Logon.vbhtml
    ~/Views/Shared/Logon.cshtml
    ~/Views/Shared/Logon.vbhtml
    LayerName:UserInterface
    StackTrace: at System.Web.Mvc.ViewResult.FindView(ControllerContext context)
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
    at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
    at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
    at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
    at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
    at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
    at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
    at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    complementaryMessage: controller:Logon, action:Logon

     
  • 相关阅读:
    Asp.Net微型服务器,只有一个文件,并且才300K大小|建议从事Asp.Net开发的博友们人手一份 狼人:
    “Asp.Net微型服务器”根据博友们的要求改版了,也出.NET4.0版本了,要更新的博友们赶快下吧 狼人:
    不经历风雨,怎么见彩虹,没有人能随随便便成功 狼人:
    C#汉字转拼音代码分享|建议收藏 狼人:
    用C#开发类似QQ输入法的不规则窗体的程序详解+代码打包分享 狼人:
    Android开发必备武器,处理X“.NET研究”ML的利器——SAX快速上手 狼人:
    “.NET研究”在iPhone应用中如何避免内存泄露 狼人:
    向量样本【模式识别】感知器 Perceptron
    编程在线庞果网 在线编程 24点游戏
    实现接口一种可靠的 DLL 接口实现方案
  • 原文地址:https://www.cnblogs.com/chucklu/p/12461878.html
Copyright © 2011-2022 走看看