Exemplo n.º 1
0
        //============================================================
        // Events
        //============================================================

        ///
        /// <summary>
        /// Raises the Init event.
        /// </summary>
        /// <remarks>
        /// 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 OnInit.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PowerPack.EnsureIdSet(this);

            if (DesignMode)
            {
            }
            else
            {
                BrowserType browserType = GetBrowserType();
                switch (browserType)
                {
                case BrowserType.FireFox2:
                case BrowserType.IE5Up:
                case BrowserType.IE6Up:
                case BrowserType.IE7Up:
                case BrowserType.Mozilla:
                case BrowserType.Netscape:
                case BrowserType.WebKit:
                    _uplevelBrowser = true;
                    break;
                }
            }

            return;
        }
Exemplo n.º 2
0
        ///
        /// <summary>
        /// Raises the <see cref="Control.Init"/> event.
        /// </summary>
        /// <remarks>
        /// When notified by this method, server controls must perform any initialization steps that are required
        /// to create and set up an instance. In this stage of the server control's lifecycle, the control's view
        /// state has yet to be populated. Additionally, you can not access other server controls when this method
        /// is called either, regardless of whether it is a child or parent to this control. Other server controls
        /// are not certain to be created and ready for access.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PowerPack.EnsureIdSet(this);

            Page.RegisterRequiresPostBack(this);

            EnsureChildControls();

            base.TabIndex = -1;

            if ((Style ["position"] == null) && (Style ["POSITION"] == null))
            {
                Style.Add("position", "absolute");
            }
            else
            {
                _explicitlyAbsolutelyPositioned = true;
            }

            if (!IsInDesignMode)
            {
                Style.Add("display", "none");
            }

            _realField.Text = Text;

            return;
        }
Exemplo n.º 3
0
        //============================================================
        // Events
        //============================================================

        ///
        /// <summary>
        /// Initialises the control and creates any necessary child controls.
        /// </summary>
        /// <remarks>
        /// This must be called by the ASP.NET system to properly initialise the control.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnInit(EventArgs e)
        {
            EnsureChildControls();

            base.OnInit(e);

            PowerPack.EnsureIdSet(this);

            Page.RegisterRequiresPostBack(this);

            if (IsIE() && EnableClientScript)
            {
                OnInit_IE();
            }
            else if (IsMozilla() && EnableClientScript)
            {
                OnInit_Moz();
            }
            else
            {
                OnInit_Default();
            }

            SetStateBasedOnEnabled();

            return;
        }
Exemplo n.º 4
0
        //============================================================
        // Properties
        //============================================================

        //============================================================
        // Events
        //============================================================

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PowerPack.EnsureIdSet(this);

            return;
        }
Exemplo n.º 5
0
        //============================================================
        // Methods
        //============================================================

        ///
        /// <summary>
        /// Raises the <see cref="Control.Init"/> event.
        /// </summary>
        /// <remarks>
        /// 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 OnInit.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnInit (EventArgs e)
        {
            base.OnInit (e);

            PowerPack.EnsureIdSet (this);

            ControlToValidate = ID;

            return;
        }
Exemplo n.º 6
0
        //============================================================
        // Events
        //============================================================

        ///
        /// <summary>
        /// Raises the <see cref="Control.Init"/> event.
        /// </summary>
        /// <remarks>
        /// When notified by this method, server controls must perform any initialization steps that are required
        /// to create and set up an instance. In this stage of the server control's lifecycle, the control's view
        /// state has yet to be populated. Additionally, you can not access other server controls when this method
        /// is called either, regardless of whether it is a child or parent to this control. Other server controls
        /// are not certain to be created and ready for access.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PowerPack.EnsureIdSet(this);

            EnsureChildControls();

            Page.RegisterRequiresPostBack(this);

            if ((DefaultToCurrentDate) && (!Page.IsPostBack))
            {
                Value = DateTime.Now;
            }

            return;
        }
Exemplo n.º 7
0
        //============================================================
        // Events
        //============================================================

        ///
        /// <summary>
        /// Initialises the control.
        /// </summary>
        /// <remarks>
        /// 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 OnInit.
        /// </remarks>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        ///
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PowerPack.EnsureIdSet(this);

            if (!DesignMode)
            {
                if (FindControl(ControlToHide) == null)
                {
                    throw new InvalidOperationException(Globalisation.GetString("controlWithIdCouldNotBeFound_Id", ControlToHide));
                }

                if (FindControl(ControlToTest) == null)
                {
                    throw new InvalidOperationException(Globalisation.GetString("controlWithIdCouldNotBeFound_Id", ControlToTest));
                }
            }

            return;
        }