简体   繁体   English

将 2 个应用程序合并在一起 (ASP.NET MVC - JavaScript)

[英]Merging 2 applications together (ASP.NET MVC - JavaScript)

So I have an application that deals with some basic membership functionality (Login, Register, User Profiles) and I also have another application that is a basic HTML page that uses JavaScript to generate questions from a database and then say if the input is correct.所以我有一个应用程序处理一些基本的会员功能(登录、注册、用户配置文件),我还有另一个应用程序是一个基本的 HTML 页面,它使用 JavaScript 从数据库生成问题,然后说输入是否正确。

What I want to do is merge the 2 applications together.我想要做的是将 2 个应用程序合并在一起。 One application is written in ASP.NET MVC C# using an SQL Server Database.使用 SQL 服务器数据库在 ASP.NET MVC C# 中编写了一个应用程序。 The other application is written in Javascript, HTML and a SQLITE database.另一个应用程序是在 Javascript、HTML 和 SQLITE 数据库中编写的。

How do I go about merging the 2 applications together?我如何 go 关于将 2 个应用程序合并在一起?

I am using Visual Studio 2019, with an ASP.NET Web Application我正在使用带有 ASP.NET Web 应用程序的 Visual Studio 2019

I have already tried to add the Javascript scripts to my Scripts folder and outside the scripts folder in the ASP.NET solution, added the HTML page to the solution and the database file.我已经尝试将 Javascript 脚本添加到我的 Scripts 文件夹和 ASP.NET 解决方案中的脚本文件夹之外,将 HTML 页面添加到解决方案和数据库文件中。

Do I need a plugin for reading SQLITE databases?我需要一个插件来读取 SQLITE 数据库吗?

What happens is that I can access the HTML page but no JavaScript will run, however I am not sure this is because of my implementation of the application or if it cannot read the SQLITE database to generate the questions.发生的情况是我可以访问 HTML 页面但没有 JavaScript 将运行,但是我不确定这是因为我执行了应用程序,或者它无法读取 SQLITE 数据库来生成问题。

I don't think I need to add any code, as both applications work fine seperately and I assume there isn't much configuration as they have no dependencies with each other.我认为我不需要添加任何代码,因为这两个应用程序可以单独正常工作,并且我认为没有太多配置,因为它们彼此之间没有依赖关系。 I just want to have a button on the HTML page of one application take me to a page on the other application in the same solution whilst both applications function correctly.我只想在一个应用程序的 HTML 页面上有一个按钮,将我带到同一解决方案中另一个应用程序的页面,同时两个应用程序 function 正确。

JavaScript Application Includes; JavaScript 应用包括;

  • Database.SQLITE数据库.SQLITE
  • Index.html索引.html
  • question.js问题.js
  • answer.js answer.js
  • main.js main.js

MVC Application includes; MVC 应用程序包括;

  • Data Class Library数据 Class 库
  • Service Class Library服务 Class 库
  • Web Application Library Web 应用程序库
    • SQL Server Database SQL 服务器数据库

hi if you add html project to asp.net project you should be sure that html project content like javascripts files are in wwwroot folder and your middlewares for routing and static files are added to startup file then be sure that js files addresses in html files are set correctly hi if you add html project to asp.net project you should be sure that html project content like javascripts files are in wwwroot folder and your middlewares for routing and static files are added to startup file then be sure that js files addresses in html files are set correctly

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

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