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


C# DataValue.GetEmailAddressFormItem方法代码示例

本文整理汇总了C#中DataValue.GetEmailAddressFormItem方法的典型用法代码示例。如果您正苦于以下问题:C# DataValue.GetEmailAddressFormItem方法的具体用法?C# DataValue.GetEmailAddressFormItem怎么用?C# DataValue.GetEmailAddressFormItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataValue的用法示例。


在下文中一共展示了DataValue.GetEmailAddressFormItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: loadData

        protected override void loadData()
        {
            var logInPb =
                PostBack.CreateFull(
                    actionGetter:
                        () =>
                        new PostBackAction( user.MustChangePassword ? ChangePassword.Page.GetInfo( info.ReturnUrl ) as ResourceInfo : new ExternalResourceInfo( info.ReturnUrl ) ) );
            var newPasswordPb = PostBack.CreateFull( id: "newPw", actionGetter: getSendNewPasswordAction );

            var registeredTable = EwfTable.Create( caption: "Registered users" );
            registeredTable.AddItem(
                new EwfTableItem(
                    ( "You may log in to this system if you have registered your email address with " + FormsAuthStatics.SystemProvider.AdministratingCompanyName ).ToCell(
                        new TableCellSetup( fieldSpan: 2 ) ) ) );

            emailAddress = new DataValue<string>();
            var emailVl = new BasicValidationList();
            registeredTable.AddItem(
                new EwfTableItem( "Email address", emailAddress.GetEmailAddressFormItem( "", "Please enter a valid email address.", emailVl ).ToControl() ) );
            logInPb.AddValidations( emailVl );
            newPasswordPb.AddValidations( emailVl );

            var password = new DataValue<string>();
            registeredTable.AddItem(
                new EwfTableItem(
                    "Password",
                    FormItem.Create(
                        "",
                        new EwfTextBox( "", masksCharacters: true ),
                        validationGetter: control => new EwfValidation( ( pbv, v ) => password.Value = control.GetPostBackValue( pbv ), logInPb ) ).ToControl() ) );

            if( FormsAuthStatics.PasswordResetEnabled ) {
                registeredTable.AddItem(
                    new EwfTableItem(
                        new PlaceHolder().AddControlsReturnThis(
                            "If you are a first-time user and do not know your password, or if you have forgotten your password, ".GetLiteralControl(),
                            new PostBackButton( newPasswordPb, new TextActionControlStyle( "click here to immediately send yourself a new password." ), usesSubmitBehavior: false ) )
                            .ToCell( new TableCellSetup( fieldSpan: 2 ) ) ) );
            }

            ph.AddControlsReturnThis( registeredTable );

            var specialInstructions = EwfUiStatics.AppProvider.GetSpecialInstructionsForLogInPage();
            if( specialInstructions != null )
                ph.AddControlsReturnThis( specialInstructions );
            else {
                var unregisteredTable = EwfTable.Create( caption: "Unregistered users" );
                unregisteredTable.AddItem( new EwfTableItem( "If you have difficulty logging in, please " + FormsAuthStatics.SystemProvider.LogInHelpInstructions ) );
                ph.AddControlsReturnThis( unregisteredTable );
            }

            EwfUiStatics.SetContentFootActions( new ActionButtonSetup( "Log In", new PostBackButton( logInPb ) ) );

            var logInMethod = FormsAuthStatics.GetLogInMethod(
                this,
                emailAddress,
                password,
                getUnregisteredEmailMessage(),
                "Incorrect password. If you do not know your password, enter your email address and send yourself a new password using the link below.",
                logInPb );
            logInPb.AddModificationMethod( () => user = logInMethod() );
        }
开发者ID:enduracode,项目名称:enterprise-web-library,代码行数:62,代码来源:LogIn.aspx.cs


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