示例#1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ClientScriptProxy proxy = ClientScriptProxy.Current;

            proxy.Require(CurrentSite, Require);

            foreach (string css in StringUtil.Split(Css, ",", true, true))
            {
                if (css.Contains("|"))
                {
                    string[] array = StringUtil.Split(css, "|", true, true);
                    if (array.Length != 2)
                    {
                        continue;
                    }

                    proxy.RegisterCssResource(array[1], array[0]);
                }
                else if (css.EndsWith(".css", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (css.StartsWith("~"))
                    {
                        proxy.RegisterCss(ServerUtil.ResolveUrl(css));
                    }
                    else if (css.StartsWith("."))
                    {
                        proxy.RegisterCss(StringUtil.CombinUrl(CurrentSite.VirtualPath, CurrentSite.ThemeRoot, MobileDetect.Instance.GetRealThemeName(CurrentSite), css.Substring(1)));
                    }
                    else
                    {
                        proxy.RegisterCss(StringUtil.CombinUrl(CurrentSite.VirtualPath, css));
                    }
                }
                else
                {
                    proxy.RegisterCssResource(string.Format("Kiss.Web.jQuery.{0}.css", css));
                }
            }
        }