public static MvcHtmlString ViewSpecificRequireJs(this HtmlHelper helper) { PathPartPinPointer p = new PathPartPinPointer(helper); string path = string.Format("Controllers/{0}/{1}/{2}/{2}", p.Area, p.Controller, p.Action); return RequireJs(helper.ViewContext.HttpContext, "application.js", path); }
public static MvcHtmlString BodyClassNames(this HtmlHelper helper) { PathPartPinPointer p = new PathPartPinPointer(helper); string classes = string.Format("{0} {1} {2}", p.Area, p.Controller, p.Action); return new MvcHtmlString(classes.ToLower()); }
public static MvcHtmlString ViewSpecificRequireJs(this HtmlHelper helper) { PathPartPinPointer p = new PathPartPinPointer(helper); string path = string.Format("Controllers/{0}/{1}/{2}/{2}", p.Area, p.Controller, p.Action); return(RequireJs(helper.ViewContext.HttpContext, "application.js", path)); }
public static MvcHtmlString BodyClassNames(this HtmlHelper helper) { PathPartPinPointer p = new PathPartPinPointer(helper); string classes = string.Format("{0} {1} {2}", p.Area, p.Controller, p.Action); return(new MvcHtmlString(classes.ToLower())); }
public static MvcHtmlString AreaSpecificCss(this HtmlHelper helper) { PathPartPinPointer p = new PathPartPinPointer(helper); string path = string.Format("Content/App/Areas/{0}.css", p.Area); string file = Path.Combine("\\Content", "App", "Areas", p.Area + ".css"); string link = ""; HttpContextBase context = helper.ViewContext.HttpContext; if (File.Exists(context.Server.MapPath(file))) { link = string.Format("<link rel=\"stylesheet\" href=\"/{0}\">", path); } return new MvcHtmlString(link); }
public static MvcHtmlString AreaSpecificCss(this HtmlHelper helper) { PathPartPinPointer p = new PathPartPinPointer(helper); string path = string.Format("Content/App/Areas/{0}.css", p.Area); string file = Path.Combine("\\Content", "App", "Areas", p.Area + ".css"); string link = ""; HttpContextBase context = helper.ViewContext.HttpContext; if (File.Exists(context.Server.MapPath(file))) { link = string.Format("<link rel=\"stylesheet\" href=\"/{0}\">", path); } return(new MvcHtmlString(link)); }