예제 #1
0
파일: Helper.cs 프로젝트: Oxigen2/Oxigen
        /* Protected Methods. */

        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            string src = Src;

            if (src.Length > 0)
            {
                string resolved = src;
                resolved = Page.ResolveUrl(resolved);
                if (!src.StartsWith("http://") && !src.StartsWith("https://"))
                {
                    resolved = ChecksumHelper.AppendChecksum(Context, resolved);
                }


                writer.AddAttribute(HtmlTextWriterAttribute.Src, resolved);
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");

            if (Defer)
            {
                writer.AddAttribute("defer", "defer");
            }
            string charset = Charset;

            if (charset.Length > 0)
            {
                writer.AddAttribute("charset", charset);
            }
        }
예제 #2
0
파일: Helper.cs 프로젝트: Oxigen2/Oxigen
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            string href = Href;

            if (href.Length > 0)
            {
                string resolved = Page.ResolveUrl(href);
                resolved = ChecksumHelper.AppendChecksum(Context, resolved);
                writer.AddAttribute(HtmlTextWriterAttribute.Href, resolved);
            }
            string media = Media;

            if (media.Length > 0)
            {
                writer.AddAttribute("media", media);
            }
            writer.AddAttribute("type", "text/css");
            writer.AddAttribute("rel", "stylesheet");
        }