Se crea una clase por ejemplo ConentUrlHelper.cs
namespace CrewNetix.helper
{
public static class ContentUrlHelper
{
public static string ContentArea(this UrlHelper url, string path)
{
var modulName = url.RequestContext.RouteData.DataTokens["area"];
string modulContentLoad = "";
if (modulName != null)
{
if (!string.IsNullOrEmpty(modulName.ToString()))
modulContentLoad = "Areas/" + modulName;
if (path.StartsWith("~/"))
path = path.Remove(0, 2);
if (path.StartsWith("/"))
path = path.Remove(0, 1);
path = path.Replace("../", string.Empty);
return VirtualPathUtility.ToAbsolute("~/" + modulContentLoad + "/" + path);
}
return string.Empty;
}
}
}
y de esta manera se puede acceder a los archivos:
<script src="@Url.ContentArea("Script/PageLoad.js")" ></script>
<script src="@Url.ContentArea("Script/jquery-1.9.1.min.js")" ></script>
<script src="@Url.ContentArea("Script/kendo.all.min.js")" ></script>
<script src="@Url.ContentArea("Script/kendo.web.min.js")" ></script>
<link href="@Url.ContentArea("Content/Css/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.ContentArea("Content/Css/kendo.default.min.css")" rel="stylesheet" type="text/css" />
usted debe tratar de visitar la dirección de enlace de css de la fuente vista en la pestaña separaete y comprobar qué error no se dan – archil
esto fue respondida aquí. comprobar que funciona http://stackoverflow.com/questions/7495780/mvc-3-wont-serve-content-files-from-areas-subfolder – Jay
¿El '@ Url.Content (" ~/contenido/MaterialPacking .css ")' ¿trabajo? – jrummell