public override void RenderBeforeControl(HtmlTextWriter writer) { string width = ""; if (ParentComboBox.Width.Type == UnitType.Percentage) { width = " width: " + ParentComboBox.Width + ";"; ParentComboBox.Width = Unit.Percentage(100); } writer.Write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"display: inline; margin: 0px; padding: 0px; vertical-align: -6px;" + width + ";"); string positionName = CssHelper.GetCaseInsensitiveName(Style, "POSITION"); if ((positionName != null) && (Style [positionName] != null)) { writer.Write(positionName); writer.Write(": "); writer.Write(Style [positionName]); writer.Write(";"); } string leftName = CssHelper.GetCaseInsensitiveName(Style, "LEFT"); if ((leftName != null) && (Style [leftName] != null)) { writer.Write(leftName); writer.Write(": "); writer.Write(Style [leftName]); writer.Write(";"); Style.Remove(leftName); } string topName = CssHelper.GetCaseInsensitiveName(Style, "TOP"); if ((topName != null) && (Style [topName] != null)) { writer.Write(topName); writer.Write(": "); writer.Write(Style [topName]); writer.Write(";"); Style.Remove(topName); } writer.Write("\"><tr><td width=\"100%\"><div style=\"position: relative;\">"); return; }
/// /// <summary> /// Raises the Load event. /// </summary> /// <remarks> /// This method notifies the server control that it should perform actions common to each HTTP request /// for the page it is associated with, such as setting up a database query. At this stage in the page /// lifecycle, server controls in the hierarchy are created and initialized, view state is restored, /// and form controls reflect client-side data. /// </remarks> /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param> /// protected override void OnLoad(EventArgs e) { // if ((!_nLoadPostDataCalled) && (this.Page.IsPostBack)) // { // LoadPostData (this.ID, HttpContext.Current.Request.Form); // } base.OnLoad(e); EnsureChildControls(); _realField.AddAttributes(Attributes); foreach (string key in Style.Keys) { if (Normaliser.StringCompare(key, "position")) { if (_explicitlyAbsolutelyPositioned) { _realField.Style.Add(key, Style [key]); } } else if (!Normaliser.StringCompare(key, "display")) { _realField.Style.Add(key, Style [key]); } } if (_explicitlyAbsolutelyPositioned) { string topName = CssHelper.GetCaseInsensitiveName(Style, "TOP"); if (topName != null) { Style.Remove(topName); } string leftName = CssHelper.GetCaseInsensitiveName(Style, "LEFT"); if (leftName != null) { Style.Remove(leftName); } } return; }