7 February, 2012
0 Comments
1 category
In your "*.cshtml" pages, use Url.Content and don’t directly specify the locations of the JavaScript files, because specifying the JavaSript files directly will result in 404 error, when using a virtual directory/application within a IIS website.
So use
<!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script> </head>
and don’t use:
<!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <link href="/Content/Site.css" rel="stylesheet" type="text/css" /> <script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script> </head>
Tags: MVC
Category: Uncategorized