/// <summary> /// Renders the output of the control /// </summary> /// <param name="output">The response writer.</param> protected override void DoRender(HtmlTextWriter output) { // <link rel="stylesheet" media="screen" type="text/css" href="/css/ie8.css"> var attributes = new List<HtmlAttribute>(); attributes.Add(new HtmlAttribute(HtmlTextWriterAttribute.Href, this.GetAbsoluteUrl(this.Href))); if (!string.IsNullOrEmpty(this.Rel)) { attributes.Add(new HtmlAttribute(HtmlTextWriterAttribute.Rel, this.Rel)); } if (!string.IsNullOrEmpty(this.Media)) { attributes.Add(new HtmlAttribute("media", this.Media)); } // ReSharper disable CSharpWarnings::CS0612 if (!string.IsNullOrEmpty(this.LinkType)) { attributes.Add(new HtmlAttribute(HtmlTextWriterAttribute.Type, this.LinkType)); } // ReSharper restore CSharpWarnings::CS0612 output.RenderSelfClosingTag(HtmlTextWriterTag.Link, attributes.ToArray()); }
/// <summary> /// Builds the jquery-tokeninput control. /// </summary> /// <param name="output">The HtmlTextWriter control used to output the control.</param> protected override void DoRender(HtmlTextWriter output) { var fieldValue = string.Empty; if (!string.IsNullOrEmpty(this.Value)) { var list = new ListString(this.Value); fieldValue = string.Join("|", list.Items); } var controlId = "{0}_Value".FormatWith(ID); output.RenderSelfClosingTag( HtmlTextWriterTag.Input, new HtmlAttribute("id", controlId), new HtmlAttribute("style", "width:100%"), new HtmlAttribute("value", fieldValue)); if (this.Source.StartsWith("lucene:", StringComparison.InvariantCultureIgnoreCase)) { this.RenderServiceOptions(output, this.Source, controlId); } else { this.RenderManualOptions(output, this.Source, controlId); } }