简体   繁体   English

Javascript、HTML 网站的 Visual Studio 项目,带调试

[英]Visual Studio project for Javascript, HTML website with debugging

I want to play with javascript and html and a bit more and would like to do so in Visual Studio.我想玩 javascript 和 html 等等,并想在 Visual Studio 中这样做。 There is a very similar question here . 这里有一个非常相似的问题。 The solution says I can can create an empty ASP.Net Web site and use that.该解决方案说我可以创建一个空的 ASP.Net Web 站点并使用它。 But I can't find a project template for an 'empty ASP.Net Web site'.但我找不到“空的 ASP.Net Web 站点”的项目模板。 The closest I get is 'ASP.net core empty project' and that uses c# and I can't see how to get my html and javascript involved.我得到的最接近的是“ASP.net core empty project”,它使用 c#,我看不出如何让我的 html 和 javascript 参与其中。 How can I get this 'empty ASP.Net Web site' or how can I use the 'ASP.net core empty project'?我怎样才能得到这个“空的 ASP.Net Web 站点”或如何使用“ASP.net 核心空项目”?

As GrafiCode said.正如 GrafiCode 所说。 Create an empty ASP.Net website.创建一个空的 ASP.Net 网站。

enter image description here在此处输入图像描述

enter image description here在此处输入图像描述

The image above shows how to create an empty ASP.Net website.上图显示了如何创建一个空的 ASP.Net 网站。 Hope it helps you.希望它可以帮助你。

ASP.Net always represents the backend, where your data come from and in "Views" you can just create normal html pages and of cause you can use Java script in there. ASP.Net 始终代表后端,您的数据来自哪里,在“视图”中,您可以创建普通的 html 页面,当然您可以在其中使用 Java 脚本。

HomeController家庭控制器

public IActionResult Index()
{
    return View();
}

And in Views you have a Index file in "Home".在视图中,您在“主页”中有一个索引文件。 There you can start with your page, but data only comes from the C# code if you need data from the database.在那里您可以从您的页面开始,但如果您需要数据库中的数据,则数据仅来自 C# 代码。

But my recommendation would be, if you just want to use html and javascript.但我的建议是,如果您只想使用 html 和 javascript。 Install VS Code and javascript via nvm and create a file index.html.通过 nvm 安装 VS Code 和 javascript 并创建文件 index.html。

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

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