![](/img/trans.png)
[英]asp.net c# working with iis express but not with iis local
[英]ASP.NET MVC 5 C# URL is different during Debugging/Deploying between IIS Express and Local IIS
我来自经典ASP背景,现在正尝试迁移到ASP.NET MVC。 当我使用IIS Express与本地IIS进行调试/部署时,我感到困惑。
对于IIS Express,当我第一次在Visual Studio 2017中的Login.cshmtl
选项卡上启动网站时,我将转到以下URL http://localhost:44300/
如果切换到本地IIS,我将转到该URL http://localhost/BRO
使用那里的BRO,我的后续路由将无法工作,并且我所有的glyphicons
引用都指向错误的路径。 所有其他引用也不起作用
================================================== ========================
除了字体引用之外,如果登录页面使用不同的URL触发,则所有其他引用都将成为麻烦
***I am not sure which url I will work***
var url = 'Login' **This works when http://localhost:44300/Home/Login***
****
var url = 'Home/Login' **This works when only http://localhost:44300***
**In the http://localhost/BRO situation**
var url= **I am not sure what will work here**
var formData = $('#formLogin').serialize();
$.ajax({
url: url,
type: "POST",
***Another anchor tag with href will reference wrongly***
<a href="/Password/ForgotPassword" class="btn btn-link">Forgot password?</a>
================================================== ========================
网页
解决方案资源管理器
IIS
如何使URL相同? 请帮忙
对字形使用以下类型的网址:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.