protected void UserLogOff(object sender, EventArgs e)
        {
            SingleAuthenticator authService = new SingleAuthenticator(_LoginUserName);

            authService.RemoveUserFromCache(_LoginUserName);

            Session["UserCache"]  = authService._UserCache;
            Session["MyUserName"] = null;

            string returnUrl = "~/Login.aspx";

            Response.Redirect(returnUrl);
        }
        private void ConstructApplicationLinks()
        {
            SingleAuthenticator authService        = new SingleAuthenticator(_LoginUserName);
            DataTable           applicationResults = authService.GetAppAccessDetails();

            foreach (DataRow application in applicationResults.Rows)
            {
                HyperLink _hyperlink = new HyperLink();
                _hyperlink.Text        = application["ApplicationName"].ToString();
                _hyperlink.NavigateUrl = authService.AuthenticateClientUrl(application["ApplicationURL"].ToString());
                divLinks.Controls.Add(_hyperlink);
                divLinks.Controls.Add(new LiteralControl("<BR>"));
            }
        }
        protected void LoginControl_Authentication(object sender, AuthenticateEventArgs e)
        {
            _MyAuthenticator = new SingleAuthenticator(LoginControl.UserName);

            if (_MyAuthenticator.AuthenticateUser(LoginControl.Password))
            {
                Session["MyUserName"] = LoginControl.UserName;

                _MyAuthenticator.CheckUserCache();
                _MyAuthenticator.AssignUserToCache(UserCache.LoginFrom.FromMaster);
                Session["UserCache"] = _MyAuthenticator._UserCache;

                _ReturnUrl = "~/MainAppPage.aspx";
                Response.Redirect(_ReturnUrl);
            }
        }