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

C# WebControls.CreateUserWizard类代码示例

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

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



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

示例1: PersistUserData

        /// <summary>
        /// Save the user's data into the database using the Entity Framework
        /// </summary>
        /// <param name="wizard">The wizard that took the user's details</param>
        protected void PersistUserData(CreateUserWizard wizard)
        {
            TextBox FirstNameInput = wizard.CreateUserStep.ContentTemplateContainer.FindControl("FirstName") as TextBox;
            TextBox LastNameInput = wizard.CreateUserStep.ContentTemplateContainer.FindControl("LastName") as TextBox;

            using (DMSContext database = new DMSContext())
            {
                // Check whether this user already exists first...
                // Create a new row if it doesn't exist or update the old one if it does.
                var existingUser = database.Users.SingleOrDefault(
                    u => u.UserName == wizard.UserName);
                if (existingUser == null)
                {
                    User user = new User();
                    user.UserName = wizard.UserName;
                    user.Email = wizard.Email;
                    user.FirstName = FirstNameInput.Text;
                    user.LastName = LastNameInput.Text;

                    database.Users.Add(user);
                    database.SaveChanges();
                }
                else
                {
                    existingUser.UserName = wizard.UserName;
                    existingUser.Email = wizard.Email;
                    existingUser.FirstName = FirstNameInput.Text;
                    existingUser.LastName = LastNameInput.Text;
                    database.SaveChanges();
                }
            }
        }
开发者ID:AlexHayton,项目名称:BrunswickDMS,代码行数:36,代码来源:Register.aspx.cs


示例2: SendWelcomeEmail

        private void SendWelcomeEmail(CreateUserWizard c)
        {
            var message = new MailMessage
            {
                From = new MailAddress(FromEmailAddress),
                Subject = "Welcome to PhishMarket",
                IsBodyHtml = false
            };

            message.To.Add(new MailAddress(c.Email));
            message.CC.Add(new MailAddress(CarbonCopyEmailAddress));

            message.Body = SetBody(c.UserName, c.Password);

            var client = new SmtpClient();

            client.Send(message);
        }
开发者ID:coredweller,项目名称:PhishMarket,代码行数:18,代码来源:CreateUser.aspx.cs


示例3: CompleteStepContainer

			public CompleteStepContainer (CreateUserWizard createUserWizard)
				: base (createUserWizard)
			{
				_createUserWizard = createUserWizard;
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:5,代码来源:CreateUserWizard.cs


示例4: CreateUserNavigationContainer

			public CreateUserNavigationContainer (CreateUserWizard createUserWizard)
				: base (createUserWizard)
			{
				_createUserWizard = createUserWizard;
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:5,代码来源:CreateUserWizard.cs


示例5: WriteContinuePanel

 private void WriteContinuePanel(HtmlTextWriter writer, CreateUserWizard wizard)
 {
     string id = "ContinueButton";
     string idWithType = WebControlAdapterExtender.MakeIdWithButtonType(id, wizard.ContinueButtonType);
     Control btn = wizard.FindControl("CompleteStepContainer").FindControl(idWithType);
     if (btn != null)
     {
         Page.ClientScript.RegisterForEventValidation(btn.UniqueID);
         WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-ContinuePanel");
         Extender.WriteSubmit(writer, wizard.ContinueButtonType, wizard.ContinueButtonStyle.CssClass, "CompleteStepContainer_ContinueButton", wizard.ContinueButtonImageUrl, "", wizard.ContinueButtonText);
         WebControlAdapterExtender.WriteEndDiv(writer);
     }
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:13,代码来源:CreateUserWizardAdapter.cs


示例6: WriteCreateUserButtonPanel

        private void WriteCreateUserButtonPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            Control btnParentCtrl = wizard.FindControl("__CustomNav0");
            if (btnParentCtrl != null)
            {
                string id = "_CustomNav0_StepNextButton";
                string idWithType = WebControlAdapterExtender.MakeIdWithButtonType("StepNextButton", wizard.CreateUserButtonType);
                Control btn = btnParentCtrl.FindControl(idWithType);
                if (btn != null)
                {
                    Page.ClientScript.RegisterForEventValidation(btn.UniqueID);

                    PostBackOptions options = new PostBackOptions(btn, "", "", false, false, false, false, true, wizard.ID);
                    string javascript = "javascript:" + Page.ClientScript.GetPostBackEventReference(options);
                    javascript = Page.Server.HtmlEncode(javascript);

                    WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-CreateUserButtonPanel");

                    Extender.WriteSubmit(writer, wizard.CreateUserButtonType, wizard.CreateUserButtonStyle.CssClass, id, wizard.CreateUserButtonImageUrl, javascript, wizard.CreateUserButtonText);

                    if (wizard.DisplayCancelButton)
                    {
                        Extender.WriteSubmit(writer, wizard.CancelButtonType, wizard.CancelButtonStyle.CssClass, "_CustomNav0_CancelButton", wizard.CancelButtonImageUrl, "", wizard.CancelButtonText);
                    }

                    WebControlAdapterExtender.WriteEndDiv(writer);
                }
            }
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:29,代码来源:CreateUserWizardAdapter.cs


示例7: WriteAnswerPanel

        private void WriteAnswerPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            if ((WizardMembershipProvider != null) && WizardMembershipProvider.RequiresQuestionAndAnswer)
            {
                TextBox textBox = wizard.FindControl("CreateUserStepContainer").FindControl("Answer") as TextBox;
                if (textBox != null)
                {
                    Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

                    WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-AnswerPanel");
                    Extender.WriteTextBox(writer, false, wizard.LabelStyle.CssClass, wizard.AnswerLabelText, wizard.TextBoxStyle.CssClass, "CreateUserStepContainer_Answer", "");
                    WebControlAdapterExtender.WriteRequiredFieldValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("AnswerRequired") as RequiredFieldValidator, wizard.ValidatorTextStyle.CssClass, "Answer", wizard.AnswerRequiredErrorMessage);
                    WebControlAdapterExtender.WriteEndDiv(writer);
                }
            }
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:16,代码来源:CreateUserWizardAdapter.cs


示例8: WritePasswordHintPanel

 private void WritePasswordHintPanel(HtmlTextWriter writer, CreateUserWizard wizard)
 {
     if (!String.IsNullOrEmpty(wizard.PasswordHintText))
     {
         WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-PasswordHintPanel");            
         WebControlAdapterExtender.WriteSpan(writer, "", wizard.PasswordHintText);
         WebControlAdapterExtender.WriteEndDiv(writer);
     }
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:9,代码来源:CreateUserWizardAdapter.cs


示例9: AddTitleRow

 private static void AddTitleRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     TableRow row = CreateUserWizard.CreateDoubleSpannedColumnRow(2, new Control[] { container.Title });
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:CreateUserWizard.cs


示例10: AddPasswordRow

 private void AddPasswordRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     if (this._wizard.ConvertingToTemplate)
     {
         container.PasswordLabel.RenderAsLabel = true;
     }
     List<Control> list = new List<Control> {
         container.PasswordTextBox
     };
     if (!this._wizard.AutoGeneratePassword)
     {
         list.Add(container.PasswordRequired);
     }
     TableRow row = CreateUserWizard.CreateTwoColumnRow(container.PasswordLabel, list.ToArray());
     this._wizard._passwordTableRow = row;
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:CreateUserWizard.cs


示例11: AddPasswordRegexValidatorRow

 private void AddPasswordRegexValidatorRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     TableRow row = CreateUserWizard.CreateDoubleSpannedColumnRow(2, new Control[] { container.PasswordRegExpValidator });
     this._wizard._passwordRegExpRow = row;
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:CreateUserWizard.cs


示例12: AddPasswordHintRow

 private void AddPasswordHintRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     TableRow row = CreateUserWizard.CreateTableRow();
     TableCell cell = CreateUserWizard.CreateTableCell();
     row.Cells.Add(cell);
     TableCell cell2 = CreateUserWizard.CreateTableCell();
     cell2.Controls.Add(container.PasswordHintLabel);
     row.Cells.Add(cell2);
     this._wizard._passwordHintTableRow = row;
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:CreateUserWizard.cs


示例13: AddInstructionRow

 private static void AddInstructionRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     TableRow row = CreateUserWizard.CreateDoubleSpannedColumnRow(2, new Control[] { container.InstructionLabel });
     row.PreventAutoID();
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:CreateUserWizard.cs


示例14: AddHelpPageLinkRow

 private static void AddHelpPageLinkRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     TableRow row = CreateUserWizard.CreateDoubleSpannedColumnRow(new Control[] { container.HelpPageIcon, container.HelpPageLink });
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:CreateUserWizard.cs


示例15: DefaultCreateUserContentTemplate

 internal DefaultCreateUserContentTemplate(CreateUserWizard wizard)
 {
     this._wizard = wizard;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:CreateUserWizard.cs


示例16: CreateTestControl

		public static CreateUserWizard CreateTestControl (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);

			CreateUserWizard w = new CreateUserWizard ();
			w.ID = "CreateUserWizard1";

			CreateUserWizardStep step1 = new CreateUserWizardStep ();
			CompleteWizardStep step2 = new CompleteWizardStep ();

			w.MembershipProvider = "FakeProvider";
			w.WizardSteps.Add (step1);
			w.WizardSteps.Add (step2);

			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (w);
			p.Form.Controls.Add (lce);

			//p.ClientScript.RegisterForEventValidation (w.ID);

			return w;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:23,代码来源:CreateUserWizardTest.cs


示例17: WriteFailurePanel

 private void WriteFailurePanel(HtmlTextWriter writer, CreateUserWizard wizard)
 {
     string className = (wizard.ErrorMessageStyle != null) && (!String.IsNullOrEmpty(wizard.ErrorMessageStyle.CssClass)) ? wizard.ErrorMessageStyle.CssClass + " " : "";
     className += "AspNet-CreateUserWizard-FailurePanel";
     WebControlAdapterExtender.WriteBeginDiv(writer, className);
     WebControlAdapterExtender.WriteSpan(writer, "", _currentErrorText);            
     WebControlAdapterExtender.WriteEndDiv(writer);
 }
开发者ID:jordan49,项目名称:websitepanel,代码行数:8,代码来源:CreateUserWizardAdapter.cs


示例18: AddUserNameRow

 private void AddUserNameRow(Table table, CreateUserWizard.CreateUserStepContainer container)
 {
     if (this._wizard.ConvertingToTemplate)
     {
         container.UserNameLabel.RenderAsLabel = true;
     }
     TableRow row = CreateUserWizard.CreateTwoColumnRow(container.UserNameLabel, new Control[] { container.UserNameTextBox, container.UserNameRequired });
     table.Rows.Add(row);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:CreateUserWizard.cs


示例19: WriteEmailPanel

        private void WriteEmailPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            TextBox textBox = wizard.FindControl("CreateUserStepContainer").FindControl("Email") as TextBox;
            if (textBox != null)
            {
                Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

                WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-EmailPanel");
                Extender.WriteTextBox(writer, false, wizard.LabelStyle.CssClass, wizard.EmailLabelText, wizard.TextBoxStyle.CssClass, "CreateUserStepContainer_Email", "");
                WebControlAdapterExtender.WriteRequiredFieldValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("EmailRequired") as RequiredFieldValidator, wizard.ValidatorTextStyle.CssClass, "Email", wizard.EmailRequiredErrorMessage);
                WebControlAdapterExtender.WriteEndDiv(writer);
            }
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:13,代码来源:CreateUserWizardAdapter.cs


示例20: ConstructControls

 private void ConstructControls(CreateUserWizard.CreateUserStepContainer container)
 {
     string validationGroup = this._wizard.ValidationGroup;
     container.Title = CreateUserWizard.CreateLiteral();
     container.InstructionLabel = CreateUserWizard.CreateLiteral();
     container.PasswordHintLabel = CreateUserWizard.CreateLiteral();
     TextBox box = new TextBox {
         ID = "UserName"
     };
     container.UserNameTextBox = box;
     TextBox box2 = new TextBox {
         ID = "Password",
         TextMode = TextBoxMode.Password
     };
     container.PasswordTextBox = box2;
     TextBox box3 = new TextBox {
         ID = "ConfirmPassword",
         TextMode = TextBoxMode.Password
     };
     container.ConfirmPasswordTextBox = box3;
     bool enableValidation = true;
     container.UserNameRequired = CreateUserWizard.CreateRequiredFieldValidator("UserNameRequired", validationGroup, container.UserNameTextBox, enableValidation);
     container.UserNameLabel = CreateUserWizard.CreateLabelLiteral(container.UserNameTextBox);
     container.PasswordLabel = CreateUserWizard.CreateLabelLiteral(container.PasswordTextBox);
     container.ConfirmPasswordLabel = CreateUserWizard.CreateLabelLiteral(container.ConfirmPasswordTextBox);
     Image image = new Image();
     image.PreventAutoID();
     container.HelpPageIcon = image;
     HyperLink link = new HyperLink {
         ID = "HelpLink"
     };
     container.HelpPageLink = link;
     Literal literal = new Literal {
         ID = "ErrorMessage"
     };
     container.ErrorMessageLabel = literal;
     TextBox box4 = new TextBox {
         ID = "Email"
     };
     container.EmailTextBox = box4;
     container.EmailRequired = CreateUserWizard.CreateRequiredFieldValidator("EmailRequired", validationGroup, container.EmailTextBox, enableValidation);
     container.EmailLabel = CreateUserWizard.CreateLabelLiteral(container.EmailTextBox);
     RegularExpressionValidator validator = new RegularExpressionValidator {
         ID = "EmailRegExp",
         ControlToValidate = "Email",
         ErrorMessage = this._wizard.EmailRegularExpressionErrorMessage,
         ValidationExpression = this._wizard.EmailRegularExpression,
         ValidationGroup = validationGroup,
         Display = ValidatorDisplay.Dynamic,
         Enabled = enableValidation,
         Visible = enableValidation
     };
     container.EmailRegExpValidator = validator;
     container.PasswordRequired = CreateUserWizard.CreateRequiredFieldValidator("PasswordRequired", validationGroup, container.PasswordTextBox, enableValidation);
     container.ConfirmPasswordRequired = CreateUserWizard.CreateRequiredFieldValidator("ConfirmPasswordRequired", validationGroup, container.ConfirmPasswordTextBox, enableValidation);
     RegularExpressionValidator validator2 = new RegularExpressionValidator {
         ID = "PasswordRegExp",
         ControlToValidate = "Password",
         ErrorMessage = this._wizard.PasswordRegularExpressionErrorMessage,
         ValidationExpression = this._wizard.PasswordRegularExpression,
         ValidationGroup = validationGroup,
         Display = ValidatorDisplay.Dynamic,
         Enabled = enableValidation,
         Visible = enableValidation
     };
     container.PasswordRegExpValidator = validator2;
     CompareValidator validator3 = new CompareValidator {
         ID = "PasswordCompare",
         ControlToValidate = "ConfirmPassword",
         ControlToCompare = "Password",
         Operator = ValidationCompareOperator.Equal,
         ErrorMessage = this._wizard.ConfirmPasswordCompareErrorMessage,
         ValidationGroup = validationGroup,
         Display = ValidatorDisplay.Dynamic,
         Enabled = enableValidation,
         Visible = enableValidation
     };
     container.PasswordCompareValidator = validator3;
     TextBox box5 = new TextBox {
         ID = "Question"
     };
     container.QuestionTextBox = box5;
     TextBox box6 = new TextBox {
         ID = "Answer"
     };
     container.AnswerTextBox = box6;
     container.QuestionRequired = CreateUserWizard.CreateRequiredFieldValidator("QuestionRequired", validationGroup, container.QuestionTextBox, enableValidation);
     container.AnswerRequired = CreateUserWizard.CreateRequiredFieldValidator("AnswerRequired", validationGroup, container.AnswerTextBox, enableValidation);
     container.QuestionLabel = CreateUserWizard.CreateLabelLiteral(container.QuestionTextBox);
     container.AnswerLabel = CreateUserWizard.CreateLabelLiteral(container.AnswerTextBox);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:91,代码来源:CreateUserWizard.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.CustomValidator类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.CommandEventArgs类代码示例发布时间: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