• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.LoginCancelEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HeadLoginStatus_LoggingOut

 /// <summary>
 /// Si el usuario cierra sesión desde la opcion 'Cerrar sesion' del header, 
 /// actualiza el 'Estatus' de 'En linea' a 'Fuera de linea'
 /// </summary>
 /// <param name="sender">object sender</param>
 /// <param name="e">Ext.Net.DirectEventArgs e</param>
 protected void HeadLoginStatus_LoggingOut(object sender, LoginCancelEventArgs e)
 {
     //  Verifica que la variable de sesion 'Ejecutivo' no sea nula 
     if (Session["Ejecutivo"] != null)
     {
         //  Cambia el estatus del usuario a fuera de linea al cerrar sesión
         GlobalOBD.EstatusUser((int)(Session["Ejecutivo"]), 4);
     }
 }
开发者ID:pprbe3,项目名称:Cotizador,代码行数:15,代码来源:Site.Master.cs


示例17: LoginUser_LoggingIn

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


示例18: LoginStatus1_LoggingOut

        protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
        {
            // Log out the current user
            FormsAuthentication.SignOut();

            Session.Abandon();

            // Redirect back to the homepage
            Response.Redirect("~/Default.aspx");
        }
开发者ID:MarioQueiros,项目名称:radiodei-arquitectura-de-sistemas-arqsi,代码行数:10,代码来源:Site.Master.cs


示例19: LoginStatus1_LoggingOut

        protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
        {
            Member member = BLL.Member.CurrentMember;
            member.IsOnLine = false;
            member.Save();

            IHubContext _Rcontext = GlobalHost.ConnectionManager.GetHubContext<ChatRoomHub>();
            _Rcontext.Clients.All.updateMember(member.MemberID, "IsOnline", false);

            // clear all session vars
            Session.Abandon();
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:12,代码来源:Main.Master.cs


示例20: CreateUserWizard1_CreatingUser

        protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
        {
            XDocument doc = XDocument.Load(Filepath);
            var newElement = new XElement("Person", new XElement("Username", CreateUserWizard1.UserName.Trim().ToString()), new XElement("Password", CreateUserWizard1.Password.Trim().ToString())
                , new XElement("ConfirmPassword", CreateUserWizard1.ConfirmPassword.Trim().ToString())
                , new XElement("Email", CreateUserWizard1.Email.Trim().ToString())
                , new XElement("Question", CreateUserWizard1.Question.Trim().ToString())
                , new XElement("Answer", CreateUserWizard1.Answer.Trim().ToString())

                );
            doc.Element("Persons").Add(newElement);
            doc.Save(Filepath);
        }
开发者ID:nithya6n,项目名称:OnlineExamination,代码行数:13,代码来源:About.aspx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.Menu类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.Literal类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap