Rediger

Del via


CreateUserWizard.RequireEmail Property

Definition

Gets or sets a value indicating whether an email address is required for the Web site user.

public:
 virtual property bool RequireEmail { bool get(); void set(bool value); };
[System.Web.UI.Themeable(false)]
public virtual bool RequireEmail { get; set; }
[<System.Web.UI.Themeable(false)>]
member this.RequireEmail : bool with get, set
Public Overridable Property RequireEmail As Boolean

Property Value

true if an email address is required; otherwise, false. The default value is true.

Attributes

Remarks

When the RequireEmail property is true, the CreateUserWizard will display a text box and an associated label for the user to enter an email address. If the user does not enter an email address, the EmailRequiredErrorMessage property will display an error message.

If the RequireEmail property is set to true and you are using templated content, the Email control is required and the CreateUserWizard throws an exception if the Email control is not found or is of the wrong type. If RequireEmail is set to false, no exception is thrown if the Email is not found. If it is of the wrong type, it is ignored.

Note

If the membership provider specified in the MembershipProvider property requires a unique email address for new users, you must set the RequireEmail property to true so that the UI for entering an email address is displayed. Otherwise, the user will see the EmailRequiredErrorMessage but have no way to enter an email address.

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

Applies to

See also