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

后端 未结 17 2213
逝去的感伤
逝去的感伤 2020-12-15 14:42
The view \'Index\' or its master was not found. The following locations were searched:
~/Views/ControllerName/Index.aspx
~/Views/ControllerName/Index.ascx
~/Views/Sh         


        
17条回答
  •  轮回少年
    2020-12-15 15:25

    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.

提交回复
热议问题