public FileRegistrationContext RegisterStyle(string fileName, HtmlHelper html) { if (string.IsNullOrEmpty(fileName)) throw new ArgumentException(T("Style fileName was not given.").ToString()); var context = new FileRegistrationContext(html.ViewContext, html.ViewDataContainer, "link", fileName); context.SetAttribute("type", "text/css"); context.SetAttribute("rel", "stylesheet"); if (!_styles.Contains(context)) _styles.Add(context); return context; }
private static string GetTag(FileRegistrationContext fileRegistrationContext, string filePath) { fileRegistrationContext.SetAttribute(fileRegistrationContext.FilePathAttributeName, filePath); return fileRegistrationContext.GetTag(); }
public FileRegistrationContext RegisterHeadScript(string fileName, HtmlHelper html) { if (string.IsNullOrEmpty(fileName)) throw new ArgumentException(T("Head script fileName was not given.").ToString()); var context = new FileRegistrationContext(html.ViewContext, html.ViewDataContainer, "script", fileName); context.SetAttribute("type", "text/javascript"); if (!_headScripts.Contains(context)) _headScripts.Add(context); return context; }