本文整理汇总了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();
}
}
}
示例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);
}
示例3: CompleteStepContainer
public CompleteStepContainer (CreateUserWizard createUserWizard)
: base (createUserWizard)
{
_createUserWizard = createUserWizard;
}
示例4: CreateUserNavigationContainer
public CreateUserNavigationContainer (CreateUserWizard createUserWizard)
: base (createUserWizard)
{
_createUserWizard = createUserWizard;
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例9: AddTitleRow
private static void AddTitleRow(Table table, CreateUserWizard.CreateUserStepContainer container)
{
TableRow row = CreateUserWizard.CreateDoubleSpannedColumnRow(2, new Control[] { container.Title });
table.Rows.Add(row);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例15: DefaultCreateUserContentTemplate
internal DefaultCreateUserContentTemplate(CreateUserWizard wizard)
{
this._wizard = wizard;
}