视图'路由'没有找到,但实际上存在于Nopcommerce 4.5.2

发布于 2025-02-07 06:29:54 字数 421 浏览 2 评论 0原文

出现: 处理请求时发生了一个未经治疗的例外。 InvalidOperationException:找不到视图'/ogs/route.cshtml'。搜索了以下位置:/ogs/route.cshtml

尽管该文件存在于第一个路径上: nop.web =>区域=> admin =>视图=> ogs => rout.cshtml

这是控制器代码,

public class OGSRoute : BaseAdminController
{
  public virtual async Task<IActionResult> Index()
  {
    return View("/OGS/Route.cshtml");
  }
}

Appears:
An unhandled exception occurred while processing the request.
InvalidOperationException: The view '/OGS/Route.cshtml' was not found. The following locations were searched: /OGS/Route.cshtml

Although the file is present on the first path:
Nop.Web => Areas => Admin => Views => OGS => Route.cshtml

Here is the controller code,

public class OGSRoute : BaseAdminController
{
  public virtual async Task<IActionResult> Index()
  {
    return View("/OGS/Route.cshtml");
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彩虹直至黑白 2025-02-14 06:29:54

请尝试此视图名称:区域/admin/view/ogs/route.cshtml

public virtual async Task<IActionResult> Index()
{
    return View("Areas/Admin/Views/OGS/Route.cshtml");
}

Please try this viewName: Areas/Admin/Views/OGS/Route.cshtml

public virtual async Task<IActionResult> Index()
{
    return View("Areas/Admin/Views/OGS/Route.cshtml");
}
落在眉间の轻吻 2025-02-14 06:29:54

如下所示

  public partial class OGSRouteController : BaseAdminController
    {
        public virtual async Task<IActionResult> Index()
        {
            return View("Areas/Admin/Views/OGS/Route.cshtml");
        }
    }

Change like below

  public partial class OGSRouteController : BaseAdminController
    {
        public virtual async Task<IActionResult> Index()
        {
            return View("Areas/Admin/Views/OGS/Route.cshtml");
        }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文