Exemple #1
0
        /// <devdoc>
        ///    Add positioning custom attributes.
        /// </devdoc>
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            string oldCssClass = CssClass;
            Style  oldStyle    = _style;

            CssClass = String.Empty;
            _style   = null;
            ControlStyle.Reset();

            base.AddAttributesToRender(writer);

            CssClass = oldCssClass;
            _style   = oldStyle;

            // Non-configurable style attributes
            RenderStyleAttributes(writer);
        }
        ///
        /// <summary>
        /// Perform last-minute duties before rendering us and our child controls.
        /// </summary>
        /// <remarks>
        /// This method allows us to perform actions after all controls have been loaded and events
        /// processed, just before we start the rendering cycle.  We use this time to propagate style
        /// information to our child controls.
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their OnPreRender.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if ((!IsInDesignMode) && (ControlStyleCreated))
            {
                _realField.ApplyStyle(ControlStyle);
                ControlStyle.Reset();
                foreach (string styleName in Style.Keys)
                {
                    _realField.Style [styleName] = Style [styleName];
                }
            }

            ViewState ["ChosenDateValue"] = Value;

            return;
        }