If I use the following line in my default view /Home/Index
<script language="javascript" src="<%=Url.Content("~/Scripts/jquery-1.3.2.js")%>" type="text/javascript" ></script>
If I surf to this location using the following url http://127.0.0.1:9999/Home/Index the page gets rendered correctly
<script language="javascript" src="/Scripts/jquery-1.3.2.js" type="text/javascript" ></script>
If I use the following url http://127.0.0.1:9999/ (default wired to Home/Index) the page renders this:
<script language="javascript" src="//Scripts/jquery-1.3.2.js" type="text/javascript" ></script>
Does anyone has any idea how to solve this issue?
EDIT:
FYI: I'm using ASP.NET mvc 2 RC And this is my route configuration:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
If you use IIS6 or WinXP Cassini you should register one more route:
if (Environment.OSVersion.Version.Major < 6) // IIS6 and WinXP Cassini
{
routes.MapRoute(
"Root",
"",
new
{
controller = "Home",
action = "Index",
id = UrlParameter.Optional
}
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With