![](/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.