当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.LoginCancelEventArgs类代码示例

本文整理汇总了C#中System.Web.UI.WebControls.LoginCancelEventArgs的典型用法代码示例。如果您正苦于以下问题:C# LoginCancelEventArgs类的具体用法?C# LoginCancelEventArgs怎么用?C# LoginCancelEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LoginCancelEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了LoginCancelEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: cuwRegister_CreatingUser

 protected void cuwRegister_CreatingUser(object sender, LoginCancelEventArgs e)
 {
     if (cuwRegister.UserName !="") {
         DropDownList role = (DropDownList)cuwRegister.CreateUserStep.ContentTemplateContainer.FindControl("ddlRoles");
         Roles.AddUserToRole(cuwRegister.UserName, role.SelectedItem.Text);
     }
 }
开发者ID:JavaProjectGreenTeam,项目名称:AS3_TechSupport,代码行数:7,代码来源:UserRegistration.aspx.cs

示例2: LoggingOut

 protected void LoggingOut(object sender, LoginCancelEventArgs e)
 {
     Response.Cookies.Clear();
     FormsAuthentication.SignOut();
     this.Session["Redirection"] = 0;
     Response.Redirect("~/Pages/Index.aspx");
 }
开发者ID:pedromonteiro,项目名称:PW-Projecto,代码行数:7,代码来源:master.Master.cs

示例3: LoginControl_loggingIn

        protected void LoginControl_loggingIn(object sender, LoginCancelEventArgs e)
        {
            var login = sender as Login;

            if (login != null && login.UserName.IndexOf("\\") == -1)
            {
                var domain = (String.IsNullOrEmpty(this.DefaultDomain) ?
                    System.Web.Configuration.WebConfigurationManager.AppSettings["DefaultDomain"] :
                    this.DefaultDomain) ??
                    string.Empty;

                login.UserName = string.Concat(domain, "\\", login.UserName);
            }

            if (OnUserLoggingIn != null)
                OnUserLoggingIn(sender, e);

            if (login != null)
            {
                var info = new CancellableLoginInfo { UserName = login.UserName };
                LoginExtender.OnLoggingIn(info);
                e.Cancel = info.Cancel;
                login.UserName = info.UserName;
                _message = info.Message;
            }
        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:26,代码来源:LoginView.cs

示例4: OnRegister

        protected void OnRegister(object sender, LoginCancelEventArgs e)
        {
            if (this.IsValid)
            {
                try
                {
                   Account account = new Account(tbxEmail.Text, tbxName.Text, AccountType.User);
                    if(accountManagement.CreateAccount(account, tbxPassword.Text))
                    {
                        Response.Redirect("/Login.aspx");
                    }
                    else
                    {
                        FailureText.Text = "Email is al bezet.";
                        e.Cancel = true;
                    }
                }
                catch
                {
                    FailureText.Text = "Account kon niet worden aan gemaakt.";
                    e.Cancel = true;
                }

            }
        }
开发者ID:Sanko-Kallig,项目名称:Automatisch-Boodschappen-Beheer,代码行数:25,代码来源:Register.aspx.cs

示例5: RegisterUser_CreatingUser

        protected void RegisterUser_CreatingUser(object sender, LoginCancelEventArgs e)
        {
            /*
            string trimmedUserName = RegisterUser.UserName.Trim();
            if (RegisterUser.UserName.Length != trimmedUserName.Length)
            {
                // Show the error message
                InvalidUserNameOrPasswordMessage.Text = "The username cannot contain leading or trailing spaces.";
                InvalidUserNameOrPasswordMessage.Visible = true;

                // Cancel the create user workflow
                e.Cancel = true;
            }
            else
            {
                // Username is valid, make sure that the password does not contain the username
                if (RegisterUser.Password.IndexOf(RegisterUser.UserName, StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    // Show the error message
                    InvalidUserNameOrPasswordMessage.Text = "The username may not appear anywhere in the password.";
                    InvalidUserNameOrPasswordMessage.Visible = true;

                    // Cancel the create user workflow
                    e.Cancel = true;
                }
            }
            */
        }
开发者ID:yehgdotnet,项目名称:threadfix,代码行数:28,代码来源:AddNewUser.aspx.cs

示例6: OnLoggingOut

 protected void OnLoggingOut(object sender, LoginCancelEventArgs e)
 {
     string connectionString = ConfigurationManager.ConnectionStrings["BlogEntities"].ConnectionString;
     IUserRepository userRepository = new EFUserRepository(connectionString);
     ISecurityManager securityManager = new FormsSecurityManager(userRepository);
     securityManager.Logout();
 }
开发者ID:RomanOrv,项目名称:BlogProject,代码行数:7,代码来源:Site.Master.cs

示例7: lgnGeneral_LoggingIn

 protected void lgnGeneral_LoggingIn(object sender, LoginCancelEventArgs e)
 {
     if (Request.ServerVariables["REMOTE_USER"] != null)
     {
         Session["UserId"] = Util.ReturnUserId(Request.ServerVariables["REMOTE_USER"]);
     }
 }
开发者ID:fernandodlcruz,项目名称:imagebank,代码行数:7,代码来源:UC_Login.ascx.cs

示例8: LoginStatus1_LoggingOut

 protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
 {
     Session["AccCls"] = null;
     Session.Abandon();
     Session.RemoveAll();
     Response.Redirect("~/pages/Login.aspx");
 }
开发者ID:shekar348,项目名称:1PointOne,代码行数:7,代码来源:RPAdminMaster.Master.cs

示例9: loginTemplate_LoggingIn

		protected void loginTemplate_LoggingIn(object sender, LoginCancelEventArgs e) {
			if (FormsAuthentication.Authenticate(loginTemplate.UserName, loginTemplate.Password)) {
				FormsAuthentication.RedirectFromLoginPage(loginTemplate.UserName, false);
			} else {
				divMsg.Visible = true;
			}
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:7,代码来源:Logon.aspx.cs

示例10: RegisterUser_CreatingUser

        /// <summary>
        /// Handles the CreatingUser event of the RegisterUser control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.LoginCancelEventArgs"/> instance containing the event data.</param>
        protected void RegisterUser_CreatingUser(object sender, LoginCancelEventArgs e)
        {
            App_Code.Controls.RecaptchaControl captcha =
                (App_Code.Controls.RecaptchaControl)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("recaptcha") as App_Code.Controls.RecaptchaControl;

            if (Membership.GetUser(this.RegisterUser.UserName) != null)
            {
                e.Cancel = true;
                this.Master.SetStatus("warning", Resources.labels.anotherUserName);
            }
            else if (Membership.GetUserNameByEmail(this.RegisterUser.Email) != null)
            {
                e.Cancel = true;
                this.Master.SetStatus("warning", Resources.labels.anotherEmail);
            }
            else if (captcha != null)
            {
                captcha.Validate();

                if (!captcha.IsValid)
                {
                    e.Cancel = true;
                    this.Master.SetStatus("warning", "Captcha invalid.");
                }
            }
        }
开发者ID:aelagawy,项目名称:BlogEngine.NET,代码行数:31,代码来源:register.aspx.cs

示例11: RegisterUser_CreatingUser

        /// <summary>
        /// Create new user. 
        /// </summary>
        /// <param name="sender">The object that raised this event.</param>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected void RegisterUser_CreatingUser(object sender, LoginCancelEventArgs e)
        {
            //Set status text to show nothing
            status_msg.Text = "";

            //Check if email is in correct form
            if (!Regex.IsMatch(RegisterUser.Email,
              @"^(?("")(""[^""]+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))" +
              @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$"))
            {
                //Alert user what the error is
                status_msg.Text = "The email is invalid.";

                // Cancel the create user workflow
                e.Cancel = true;
            }
            //Check if user with the entered email already exists
            else if (Membership.GetUserNameByEmail(RegisterUser.Email) == RegisterUser.Email)
            {
                //Alert user what the error is
                duplicateUserMsg.Text = "A user with this email already exists. Please try again with a different email.";

                // Cancel the create user workflow
                e.Cancel = true;
            }
            else
            {
                //If everything is good, set email to be the creating username
                RegisterUser.UserName = RegisterUser.Email;
            }
        }
开发者ID:UC-CAPP-2012,项目名称:CMS,代码行数:36,代码来源:AddUser.aspx.cs

示例12: LoginStatus1_LoggingOut

        protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
        {
            

            

        }
开发者ID:gpanayir,项目名称:sffwk,代码行数:7,代码来源:main_menu_2.ascx.cs

示例13: prRecoverPassword_VerifyingUser1

 protected void prRecoverPassword_VerifyingUser1(object sender, LoginCancelEventArgs e)
 {
     if (prRecoverPassword.UserName.Contains("@"))
     {
         string username = Membership.GetUserNameByEmail(prRecoverPassword.UserName);
         if (!string.IsNullOrEmpty(username))
             prRecoverPassword.UserName = username;
     }
 }
开发者ID:postworthy,项目名称:EasyClassifieds,代码行数:9,代码来源:PasswordRecovery.aspx.cs

示例14: CreateUserWizard1_CreatingUser

 protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
 {
     (Membership.Provider as CustomMembershipProvider).FirstName = (CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtFirstName") as TextBox).Text;
     (Membership.Provider as CustomMembershipProvider).LastName = (CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtLastName") as TextBox).Text;
     (Membership.Provider as CustomMembershipProvider).Address = string.Empty;
     (Membership.Provider as CustomMembershipProvider).City = string.Empty;
     (Membership.Provider as CustomMembershipProvider).Phone = string.Empty;
     (Membership.Provider as CustomMembershipProvider).UserType = (CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("cmbUserType") as DropDownList).SelectedItem.Text;
 }
开发者ID:yoorke,项目名称:pinshop,代码行数:9,代码来源:createUser.aspx.cs

示例15: CreatingUser

        /// <summary>
        /// Handles the CreateUser event of the CreateUserWizard1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void CreatingUser(object sender, LoginCancelEventArgs e)
        {
            HIPControl captcha = (HIPControl)CreateUserWizardStep1.ContentTemplateContainer.FindControl("CapchaTest");

            if (!captcha.IsValid || !Page.IsValid)
            {
                e.Cancel = true;
            }
        }
开发者ID:chad247,项目名称:bugnet,代码行数:14,代码来源:Register.aspx.cs


注:本文中的System.Web.UI.WebControls.LoginCancelEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。