简体   繁体   English

Visual Studio ASP.NET MVC项目启动器页面显示完整的URL

[英]Visual Studio asp.net mvc project starter page shows complete url

I have started a new angularjs SPA with Microsoft ASP.net WEBAPI. 我已经使用Microsoft ASP.net WEBAPI启动了一个新的angularjs SPA。 My SPA app folder resides on the server parallel to APIs folder. 我的SPA应用程序文件夹位于与API文件夹平行的服务器上。 Hence my index file is in app folder. 因此,我的索引文件位于app文件夹中。 I right clicked on the index.html file and set it as Starter Page. 我右键单击index.html文件,并将其设置为Starter Page。 The problem is when I run the app it shows all complete URL. 问题是,当我运行该应用程序时,它会显示所有完整的URL。 like this 像这样

http://localhost:1540/Public/app/index.html

How do I hide it and only show 如何隐藏它,只显示

http://localhost:1540/

while running my index page as a starter page. 同时将我的索引页面作为初始页面运行。 It will be a problem when I deploy. 部署时会出现问题。

You have a few options. 您有几种选择。 URL Rewriting , manipulating the MVC Routing system to serve your file or as stated here return the file through MVC ie your HomeController 's Index Action. URL重写操纵MVC路由系统以服务您的文件,或者如此处所述通过MVC(即HomeControllerIndex Action)返回文件。

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

相关问题 如何在Visual Studio 2015中创建ASP.NET MVC 4项目 - How to Create an ASP.NET MVC 4 project in visual studio 2015 ASP.NET MVC入门项目出现404错误 - Getting 404 error with ASP.NET MVC starter project Visual Studio 2017 不会在 ASP.NET Core MVC 项目中创建新的空 MVC 控制器 - Visual Studio 2017 does not create a new empty MVC controller in ASP.NET Core MVC project Visual Studio Professional 2012错误:此项目引用ASP.NET MVC项目中缺少的NuGet包 - Visual Studio Professional 2012 error: This project references NuGet package(s) that are missing in ASP.NET MVC project Visual Studio Visual Studio MVC asp.NET Google Map - Visual Studio Visual Studio MVC asp.NET Google Map Asp.net MVC WebGrid中第2页的URL - URL of Page 2 in Asp.net MVC WebGrid Visual Studio 2015中的ASP.NET MVC项目中的引用似乎已被破坏 - References seem broken in ASP.NET MVC project in Visual Studio 2015 如何解决在加载ASP.NET MVC项目时挂起的Visual Studio? - How do I troubleshoot Visual Studio which is hanging when loading ASP.NET MVC project? “Visual Studio 已将 ASP.NET MVC 5 的全套依赖项添加到项目中”我可以撤消它吗? - "Visual Studio has added the full set of dependencies for ASP.NET MVC 5 to project" Can I reverse it? 将项目加载到Visual Studio Code时的ASP.NET MVC 5错误 - ASP.NET MVC 5 errors while loading the project to Visual Studio Code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM