This documentation is archived and is not being maintained.

CreateUserWizard.Question Property

Gets or sets the password recovery confirmation question entered by the user.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public virtual string Question { get; set; }
<asp:CreateUserWizard Question="String" />

Property Value

Type: System.String
The password recovery confirmation question entered by the user. The default value is an empty string ("").

The membership provider specified in the MembershipProvider property will determine whether the Question and Answer text boxes are displayed at run time. Each text box displayed on the CreateUserWizard control has a RequiredFieldValidator associated with it.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The following code example modifies the e-mail message in the SendingMail event to include the user's password recovery confirmation question in the message sent to new users.

<%@ Page Language="C#"%>
<%@ Import namespace="Samples.AspNet.CS.Controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<script runat="server">
private void Page_Load(object sender, EventArgs e) {    
    Placeholder1.Controls.Add(new CustomCreateUserWizard());

<html xmlns="" >
<head id="Head1" runat="server">
    <title>CreateUserWizard.OnSendingMail sample</title>
    <form id="form1" runat="server">
      <asp:placeholder id="Placeholder1" runat="server" >


using System;
using System.Web;
using System.Web.UI.WebControls;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls {

[AspNetHostingPermission (System.Security.Permissions.SecurityAction.Demand,
  Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (System.Security.Permissions.SecurityAction.InheritanceDemand,
  Level = AspNetHostingPermissionLevel.Minimal)]
  public class CustomCreateUserWizard : CreateUserWizard
    public CustomCreateUserWizard()
      this.MailDefinition.BodyFileName = "MailFile.txt";
      this.MailDefinition.From = "";

    protected override void OnSendingMail(MailMessageEventArgs e) 
      e.Message.Subject = "New Web site user.";

      // Replace placeholder text in message body with information
      //  provided by the user.
      e.Message.Body.Replace("<%PasswordAnswer%>", this.Answer);


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.