Beispiel #1
0
        //private static readonly string _autoCompleteUserNameInRoles = MimosaSettings.GetValue<string>(MimosaSettings.Setting.AutoCompleteUserNamesInRole);

        #endregion

        #region Overrides

        protected override void OnInit(EventArgs e)
        {
            this.Login1.LoginError += new EventHandler(Login1_LoginError);
            base.OnInit(e);

            // Determine the configuration setting so we know which username control is visible and for validation
            bool enableAutoLoginComplete = MimosaSettings.IsEnableAutoLoginComplete();

            AssignLocalPointersToControls();

            // Assign the handlers as not exposed by login control.
            _updateButton.Click += new EventHandler(UpdateButton_Click);
            _changeButton.Click += new EventHandler(ChangeButton_Click);
            _cancelButton.Click += new EventHandler(CancelButton_Click);

            // If an authentication timeout occurs, and the user performs an action that results in an AJAX callback
            // the browser hangs or errors.  To deal with this, we have to force the browser to properly reload the page
            // However, as we also have AJAX and postbacks on this page itself, we have to allow this and not force a redirect
            // Hence the check before setting redirect location.
            if (!_userNameCombo.IsCallBack && !IsPostBack)
            {
                Response.RedirectLocation = Request.Url.OriginalString;
            }

            _userNameCombo.Visible           = enableAutoLoginComplete;
            _userNameText.Visible            = !enableAutoLoginComplete;
            _userValidator.ControlToValidate = enableAutoLoginComplete ? "UserNameComboBox" : "UserName";

            if (enableAutoLoginComplete)
            {
                _userNameCombo.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(UserNameCombo_ItemsRequested);
                Login1.LoggingIn += new LoginCancelEventHandler(Login1_LoggingIn);
            }
        }