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


C# WebControls.CreateUserWizard类代码示例

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


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


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