简体   繁体   English

应用程序未在 ASP.NET 中的客户端定义为零

[英]app is not defined at client in ASP.NET Zero

I started building an application using ASP.NET Boilerplate, and as I am getting familiar with the framework I am considering a move to the paid ASP.NET Zero version.我开始使用 ASP.NET 样板构建应用程序,并且随着我对框架的熟悉,我正在考虑转向付费 ASP.NET 零版本。 I would like to assess the effort to migrate code, as it is a big code base.我想评估迁移代码的努力,因为它是一个很大的代码库。 Looking at n-layers, there are some differences in backend code but still manageable.查看 n 层,后端代码存在一些差异,但仍然可以管理。 However, the challenge I feel is in the UI as ASP.NET Zero is tightly coupled with the Metronic UI, and I am utilizing Kendo UI in my application.然而,我觉得挑战在于 UI,因为 ASP.NET Zero 与 Metronic UI 紧密结合,我在我的应用程序中使用了 Kendo UI。

I tried to download a cracked ASP.NET Zero version online.我尝试在网上下载一个破解的ASP.NET零版本。 I followed the instructions:我按照说明进行操作:

  • replace the cracked file in the nuget folder.替换nuget文件夹中的破解文件。
  • run yarn at root application.mvc project.在根 application.mvc 项目中运行纱线。

The solution and all projects build and compile fine, but I am faced with an error in the browser.该解决方案和所有项目都可以正常构建和编译,但我在浏览器中遇到错误。

Uncaught ReferenceError: app is not defined未捕获的 ReferenceError:未定义应用程序

 var _tenantChangeModal = new app.ModalManager({
    viewUrl: abp.appPath + 'Account/TenantChangeModal',
    scriptUrl: abp.appPath + 'view-resources/Views/Shared/Components/TenantChange/_ChangeModal.js',
    modalClass: 'TenantChangeModal',
    modalSize: null
});

I am not familiar with Node.js nor Angular, I use jQuery.我不熟悉Node.js也不熟悉Angular,我用的是jQuery。 This might be a simple fix as I might be missing something, or a bigger thing that requires further investigation.这可能是一个简单的修复,因为我可能遗漏了一些东西,或者需要进一步调查的更大的东西。

app.ModalManager is a JavaScript class in ASP.NET Zero. app.ModalManager是 JavaScript class 在 ASP.NET 零。

You need to bundle the JavaScript files by running npm run create-bundles from the root directory of your *.Web.Mvc project.您需要通过运行 npm 从*.Web.Mvc项目的根目录npm run create-bundles来捆绑 JavaScript 文件。

References:参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM