當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。