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

后端 未结 17 2232
逝去的感伤
逝去的感伤 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

    You can get this error even with all the correct MapRoutes in your area registration. Try adding this line to your controller action:

    If Not ControllerContext.RouteData.DataTokens.ContainsKey("area") Then
        ControllerContext.RouteData.DataTokens.Add("area", "MyAreaName")
    End If
    

提交回复
热议问题