Exemple #1
0
        public void RegisterCss(string url)
        {
            if (string.IsNullOrEmpty(url))
            {
                return;
            }

            if (IsScriptRended(url))
            {
                return;
            }

            SetScriptRended(url);

            IArea site = JContext.Current.Area;

            if (!site.CombineCss)
            {
                if (url.Contains("?"))
                {
                    url += ("&v=" + AreaConfig.Instance.CssVersion);
                }
                else
                {
                    url += ("?v=" + AreaConfig.Instance.CssVersion);
                }
            }

            Head.AddStyle(url);
        }
Exemple #2
0
        public void RegisterCssResource(string assemblyName, string resourceName, string baseUrl)
        {
            string url = Resources.Utility.GetResourceUrl(assemblyName, resourceName);

            if (IsScriptRended(url))
            {
                return;
            }

            SetScriptRended(url);

            if (string.IsNullOrEmpty(baseUrl))
            {
                Head.AddStyle(JContext.Current.Area, url, "all", HttpContext.Current, StyleRelativePosition.First, true);
            }
            else
            {
                Head.AddStyle(JContext.Current.Area, StringUtil.CombinUrl(baseUrl, url), "all", HttpContext.Current, StyleRelativePosition.First, true);
            }
        }