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

     
  • 相关阅读:
    JQuery.Ajax 错误调试帮助信息
    获取当前时间差
    选中复选框
    生成一个连接对象 生成静态页
    64位系统IIS开启32位兼容模式命令
    分割table获取数据
    JS 获取倒计时
    SqlServer 日期时间格式转换
    js 获得光标所在的文本框(text/textarea)中的位置
    .net 数据库链接的字符串
  • 原文地址:https://www.cnblogs.com/chucklu/p/12461878.html
Copyright © 2011-2022 走看看