문제

I'm not sure what's going on here. I've reformed the links in every way I can think of to try and reference my Script libraries, but nothing seems to work.

When I upload it to my web host it works fine, locally it doesn't work at all.

The weirdest part is, it references my CSS files fine and nothing else seems to have any issues.

//Works
<link href="@Url.Content("~/Content/main.css")" rel="stylesheet" type="text/css" />
//Doesn't work
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>

I'm not sure what could be going on here or really even where to debug from here. I've tried removing the @Url.Content(...) and pointing directly to the directory, but that doesn't do anything at all. Hopefully someone else has run into this issue and has figured out a solution.

Using: ASP.NET MVC3 Razor, Visual Studio 2010 Professional

도움이 되었습니까?

해결책

If you're using the default directory setup then your Scripts folder is a sub-directory of the Content folder; in which case:

<script src="@Url.Content("~/Content/Scripts/jquery-1.5.1.min.js")"></script>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top