System.Web.Mvc.CacheContent.CssInclude C# (CSharp) Method

CssInclude() public static method

Renders a CSS include tag and appends the assembly's hash code as a querystring to the file to ensure users load the latest code file when the code is updated.
public static CssInclude ( this html, Type type ) : System.Web.Mvc.MvcHtmlString
html this
type Type Pass a type so we can make a hash of its assembly. This should be a class in your web project.
return System.Web.Mvc.MvcHtmlString
        public static MvcHtmlString CssInclude(this HtmlHelper html, Type type, params string[] urls)
        {
            var sb = new StringBuilder();
            var hash = type.Assembly.GetHashCode();
            foreach (string url in urls)
                sb.AppendLine(string.Format("<link rel=\"Stylesheet\" type=\"text/css\" href=\"{0}?v={1}\" />",
                         url, hash));
            return MvcHtmlString.Create(sb.ToString());
        }