我已經看到了很多的使用Url.Content引用的JavaScript形式MasterPages例子,在MVC 2在ASP.net MVC使用Url.Content 2.0
<script src="<%: Url.Content("~/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script>
但在運行時我有故障,
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
編譯器錯誤消息:CS0103:名稱'Url'在當前上下文中不存在。
我還沒有找到Url名稱空間在哪裏聲明,應該使用額外的程序集?
VS2010,IIS 7,ASP.net MVC 2.0
如果取出該行,您的應用程序是否正常運行? – awrigley 2010-10-12 08:24:18