Can I add pre-existing Javascript code to an ASP.NET MVC C# application

Apologies if this is a silly question. I currently have a small backend system written in ASP.NET Mvc in C# that allows you to do multiple features relating to profiles (Add, Edit, Delete, View) amongst other features.

My friend has an application he created as his University project and we’re both just curious if we can merge his application with mine as his is purely a front-end system and mine is a back-end.

He has written an SQL web application that tests you with some general T-SQL questions with a pre-set SQLite3 database that you can modify based on the questions asked. He has written it all in Javascript and using HTML and CSS. He has 3 folders, a folder contaning all the javascript, a folder with an SQLITE3 database and a folder with the HTML/CSS.

I was just wondering, can I essentially ‘drag and drop’ all the 3 folders into my application on Visual Studio and will it just run seamlessly?. I assume I will need to go into the Javascript and modify any changes to the paths of the database which I can do. I’m not interested in calling any js functions or anything yet, just making it so I can start the application, be taken the HTML for the SQL application and then all the js scripts work for that page.

If this is not the case, is it a case where I can only use Javascript by injecting it into ASP.NET by using the tag <script type="text/javascript">?

Trying what I have stated. As it webpage was in HTML, I created an action in my controller that opens up the HTML page in CSHTML. This will display the HTML but no methods are called when the page loads therefore no database is loaded or what I presume to be any Javascript commands.

If there are any materials that help with this issue, can you please link them below. I had done some research but could not find anything that points to this specific issue.

48 thoughts on “Can I add pre-existing Javascript code to an ASP.NET MVC C# application”

Leave a Comment