UPDATE這個問題不會在ASP.NET MVC的釋放位存在錯誤的道路ASP.NET MVC RC返回Url.Content
我有這下運行良好的ASP.NET MVC應用程序RC調試器從http://localhost:9002/運行但是,當我將其發佈到http://localhost/Zot/對Url.Content的調用返回不正確的值。
我有一個像
<script src="<%= Url.Content("~/Scripts/util.js") %>" ...
在發佈的站點,這產生腳本標籤:
<script src="Zot/Scripts/util.js" ...
而不是
<script src="/Zot/Scripts/util.js" ...
或
<script src="Scripts/util.js" ...
我樣式表標籤,如:
<link href="~/Content/Site.css" runat="server" ...
產生正確的事情:
<link href="Content/Site.css" ...
爲什麼Url.Content失敗的任何建議。我顯然不能在<script>
標籤上放置runat="server"
。
謝謝!這很好。 – 2009-03-05 16:15:03