Redigera

Dela via


ChangePassword Class

Definition

Provides a user interface that enable users to change their Web site password.

public ref class ChangePassword : System::Web::UI::WebControls::CompositeControl
[System.ComponentModel.Bindable(false)]
public class ChangePassword : System.Web.UI.WebControls.CompositeControl
[<System.ComponentModel.Bindable(false)>]
type ChangePassword = class
    inherit CompositeControl
    interface INamingContainer
Public Class ChangePassword
Inherits CompositeControl
Inheritance
Attributes
Implements

Examples

The following code example shows how to set the NewPasswordRegularExpression property to define a regular expression that checks passwords to ensure that they meet the following criteria:

  • Are greater than six characters.

  • Contain at least one digit.

  • Contain at least one special (non-alphanumeric) character.

The password requirements contained in the PasswordHintText property are displayed to the user.

If the password entered by the user does not meet the requirements of the NewPasswordRegularExpression property, the text contained in the NewPasswordRegularExpressionErrorMessage property is displayed to the user. If a new password is not entered, the text contained in the NewPasswordRequiredErrorMessage property is displayed to the user.

Note

The new password must meet the minimum requirements set by the membership provider in the MinRequiredPasswordLength, MinRequiredNonAlphanumericCharacters, and PasswordStrengthRegularExpression properties. If the password does not meet these requirements, the ChangePasswordError event is raised.

<%@ page language="C#"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <title>Change Password with Validation</title>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <asp:changepassword id="ChangePassword1" runat="server"
  PasswordHintText = 
    "Please enter a password at least 7 characters long, 
    containing a number and one special character."
  NewPasswordRegularExpression =
    '@\"(?=.{7,})(?=(.*\d){1,})(?=(.*\W){1,})' 
  NewPasswordRegularExpressionErrorMessage =
    "Error: Your password must be at least 7 characters long, 
    and contain at least one number and one special character." >
  </asp:changepassword>
  </div>
  </form>
</body>
</html>
<%@ page language="VB"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <title>Change Password with Validation</title>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <asp:changepassword id="ChangePassword1" runat="server"
  PasswordHintText = "Please enter a password at least 7 characters long, containing a number and one special character."
  NewPasswordRegularExpression = '@\"(?=.{7,})(?=(.*\d){1,})(?=(.*\W){1,})' 
  NewPasswordRegularExpressionErrorMessage = "Your password must be at least 7 characters long, and contain at least one number and one special character.">
  </asp:changepassword>
  </div>
  </form>
</body>
</html>

Remarks

In this topic:

Introduction

Use the ChangePassword control on a page to enable your Web site users to change the passwords they use to log on to your Web site.

Note

If you are not familiar with the set of login controls available in ASP.NET, read ASP.NET Login Controls Overview before continuing. For a list of other topics related to login controls and membership, see Managing Users by Using Membership.

Important

Transmitting passwords over HTTP is a potential security threat. HTTP transmissions can be viewed or compromised by malicious users. To improve security when using login controls, you should use HTTPS protocol with secure sockets layer (SSL) encryption to ensure that the user's password cannot be read during postback. For more information, see Securing Login Controls.

The ChangePassword control uses the membership provider defined in the MembershipProvider property to change the password stored in the membership provider data store for the Web site. If you do not assign a membership provider, the ChangePassword control uses the default membership provider defined in the membership section of the Web.config file. The ChangePassword control enables users to perform the following actions:

  • Change their password if they are logged on.

  • Change their password if they are not logged on, as long as the page that contains the ChangePassword control allows anonymous access and the DisplayUserName property is true.

  • Change the password for a user account, even if they are logged on as a different user. This requires the DisplayUserName property to be true.

Setting the DisplayUserName property to true displays the User Name text box, which allows the user to type in a user name. If the user is logged on, the UserName control is populated with the name of the logged-on user. After the password for the given user name is changed, the user is logged on to the account associated with the changed password, even if the user was not logged on to that account previously.

Important

Accepting user input is a potential security threat. Malicious users can send data that is intended to expose vulnerabilities or run programs that try generated passwords. To improve security when working with user input, you should use the validation features of your control and secure any data providers that are configured for your control. For more information, see Securing Login Controls, Basic Security Practices for Web Applications, and Securing Membership.

Sending Email Messages

The ChangePassword control can be configured to use email services to send the new password to the user. To send email messages to users from any of ASP.NET Web server controls, you must configure an email server in the Web.config file for your application. For more information, see How to: Install and Configure SMTP Virtual Servers in IIS 6.0.

Email messages are configured using the MailDefinition class. You must set the BodyFileName property to instruct ASP.NET to send email.

Important

Sending user account names or passwords in email is a potential security threat. Email messages are typically sent in plain text and can be read by special network "sniffing" applications. To improve security, use the mitigations that are described in Securing Login Controls.

Note

It is not possible to guarantee that a user will receive or view an email message. To verify that a user has received a message, provide a confirmation link in the email message that lets the user confirm that the notification was received.

Views

The ChangePassword control has two states, or views:

  • Change Password view Requests the current password, and requires the user to type the new password twice for confirmation. If you allow users who are not logged on to change their passwords, set the DisplayUserName property to true to display the UserName control in Change Password view. The UserName control allows the user to provide their registered user name. If there is an error when changing the password, an error message is displayed in the Change Password view, allowing the user to try again.

  • Success view Provides confirmation that the password has been changed.

    Important

    The functionality for changing passwords and for continue and cancel is attached to any button that has the correct command name, regardless of which view the button is placed on. For example, a button with the value commandname=changepassword in the Success view will attempt to change the password and result in an exception.

Styles and Templates

You can use an extensive set of style properties to customize the appearance of the ChangePassword control. Alternatively, you can apply custom templates to the two views if you need complete control over the appearance of the ChangePassword control. If you define a template for a view, the ControlStyle properties are applied. For a list of the controls that you must set in the view templates, see the ChangePasswordTemplate and SuccessTemplate properties. The ChangePassword control examines the content in the template and throws an exception if a required control is not found, is not named correctly, or is of the wrong type. For example, if you use the content in the template and set the DisplayUserName property to true, the ChangePassword will throw an exception if a TextBox or some other IEditableTextControl control is not found for the user name.

The following table lists the ChangePassword control style properties and describes which UI element they affect. For a list of the properties to which each style applies, see the individual style property.

ChangePassword style property UI element
CancelButtonStyle Cancel button on the Change Password view.
ChangePasswordButtonStyle Change Password button on the Change Password view.
ContinueButtonStyle Continue button on the Success view.
FailureTextStyle Error text displayed to the user.
HyperLinkStyle Hyperlinks to other pages.
InstructionTextStyle Instructional text on the page that describes how to use the ChangePassword control.
LabelStyle Labels for all input fields, such as text boxes.
PasswordHintStyle Hints for providing an acceptable password for the Web site.
SuccessTextStyle Text displayed to the user when the password has been successfully changed.
TextBoxStyle Text entry input fields.
TitleTextStyle Titles for the Change Password and Success views.

Applying CSS Styles

The ChangePassword control lets you specify CSS style rules in markup. If you use templates to customize the appearance of the ChangePassword control, you can specify CSS styles in the markup in the templates. In that case, no extra outer table is required. You can prevent the table from being rendered by setting the RenderOuterTable property to false.

Validation Groupings

The ChangePassword control uses a validation group so that other fields on the same page as the ChangePassword control can be validated separately. By default, the ID property of the ChangePassword control is used as the name of the validation group. For example, a ChangePassword control with the ID "ChangePassword1" will use a validation group name of ChangePassword1 as well. To set the validation group that the ChangePassword control is part of, you must create a template with the control, and then change the validation group name.

To show error messages if a user leaves a TextBox control empty, add a ValidationSummary control to the page. Set the ValidationGroup property of the ValidationSummary control to the ID property of the ChangePassword control.

Access Keys and Tab Indexes

For information about how to use the AccessKey property and the TabIndex property of a ChangePassword control, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

Accessibility

For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

Accessing Controls During Page_Load and Page_Init

ChangePassword control properties represented by text boxes, such as UserName and CurrentPassword, are accessible during all phases of the page life cycle. In particular, during the Page_Init and Page_Load phases, these properties have the same value they had when the ChangePassword control was rendered. If the user changes the value of the UserName property by modifying the UserName text box, the new value will be available when the changed event is raised, which occurs after the Page_Load phase. Therefore, if you set the value of the UserName property in the Page_Init phase or Page_Load phase and provide a custom handler for a ChangePassword event, any change that the user makes in the UserName text box overrides the value set in the Page_Init or Page_Load phase.

Declarative Syntax

<asp:ChangePassword  
    AccessKey="string"  
    BackColor="color name|#dddddd"  
    BorderColor="color name|#dddddd"  
    BorderPadding="integer"  
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|  
        Inset|Outset"  
    BorderWidth="size"  
    CancelButtonImageUrl="uri"  
    CancelButtonText="string"  
    CancelButtonType="Button|Image|Link"  
    CancelDestinationPageUrl="uri"  
    ChangePasswordButtonImageUrl="uri"  
    ChangePasswordButtonText="string"  
    ChangePasswordButtonType="Button|Image|Link"  
    ChangePasswordFailureText="string"  
    ChangePasswordTitleText="string"  
    ConfirmNewPasswordLabelText="string"  
    ConfirmPasswordCompareErrorMessage="string"  
    ConfirmPasswordRequiredErrorMessage="string"  
    ContinueButtonImageUrl="uri"  
    ContinueButtonText="string"  
    ContinueButtonType="Button|Image|Link"  
    ContinueDestinationPageUrl="uri"  
    CreateUserIconUrl="uri"  
    CreateUserText="string"  
    CreateUserUrl="uri"  
    CssClass="string"  
    DisplayUserName="True|False"  
    EditProfileIconUrl="uri"  
    EditProfileText="string"  
    EditProfileUrl="uri"  
    Enabled="True|False"  
    EnableTheming="True|False"  
    EnableViewState="True|False"  
    Font-Bold="True|False"  
    Font-Italic="True|False"  
    Font-Names="string"  
    Font-Overline="True|False"  
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|  
        Large|X-Large|XX-Large"  
    Font-Strikeout="True|False"  
    Font-Underline="True|False"  
    ForeColor="color name|#dddddd"  
    Height="size"  
    HelpPageIconUrl="uri"  
    HelpPageText="string"  
    HelpPageUrl="uri"  
    ID="string"  
    InstructionText="string"  
    MailDefinition-BodyFileName="uri"  
    MailDefinition-CC="string"  
    MailDefinition-From="string"  
    MailDefinition-IsBodyHtml="True|False"  
    MailDefinition-Priority="Normal|Low|High"  
    MailDefinition-Subject="string"  
    MembershipProvider="string"  
    NewPasswordLabelText="string"  
    NewPasswordRegularExpression="string"  
    NewPasswordRegularExpressionErrorMessage="string"  
    NewPasswordRequiredErrorMessage="string"  
    OnCancelButtonClick="CancelButtonClick event handler"  
    OnChangedPassword="ChangedPassword event handler"  
    OnChangePasswordError="ChangePasswordError event handler"  
    OnChangingPassword="ChangingPassword event handler"  
    OnContinueButtonClick="ContinueButtonClick event handler"  
    OnDataBinding="DataBinding event handler"  
    OnDisposed="Disposed event handler"  
    OnInit="Init event handler"  
    OnLoad="Load event handler"  
    OnPreRender="PreRender event handler"  
    OnSendingMail="SendingMail event handler"  
    OnSendMailError="SendMailError event handler"  
    OnUnload="Unload event handler"  
    PasswordHintText="string"  
    PasswordLabelText="string"  
    PasswordRecoveryIconUrl="uri"  
    PasswordRecoveryText="string"  
    PasswordRecoveryUrl="uri"  
    PasswordRequiredErrorMessage="string"  
    runat="server"  
    SkinID="string"  
    Style="string"  
    SuccessPageUrl="uri"  
    SuccessText="string"  
    SuccessTitleText="string"  
    TabIndex="integer"  
    ToolTip="string"  
    UserName="string"  
    UserNameLabelText="string"  
    UserNameRequiredErrorMessage="string"  
    Visible="True|False"  
    Width="size"  
>  
        <CancelButtonStyle/>  
        <ChangePasswordButtonStyle/>  
        <ChangePasswordTemplate>  
            <!-- child controls -->  
        </ChangePasswordTemplate>  
        <ContinueButtonStyle/>  
        <FailureTextStyle/>  
        <HyperLinkStyle/>  
        <InstructionTextStyle/>  
        <LabelStyle/>  
        <MailDefinition  
            BodyFileName="uri"  
            CC="string"  
            From="string"  
            IsBodyHtml="True|False"  
            Priority="Normal|Low|High"  
            Subject="string"  
>  
                <EmbeddedObjects>  
                        <asp:EmbeddedMailObject  
                            Name="string"  
                            Path="uri"  
                        />  
                </EmbeddedObjects>  
        </MailDefinition>  
        <PasswordHintStyle/>  
        <SuccessTemplate>  
            <!-- child controls -->  
        </SuccessTemplate>  
        <SuccessTextStyle/>  
        <TextBoxStyle/>  
        <TitleTextStyle/>  
        <ValidatorTextStyle/>  
</asp:ChangePassword>  

Constructors

ChangePassword()

Initializes a new instance of the ChangePassword class.

Fields

CancelButtonCommandName

Represents the CommandName value of the Cancel button. This field is read-only.

ChangePasswordButtonCommandName

Represents the CommandName value of the Change Password button. This field is read-only.

ContinueButtonCommandName

Represents CommandName value of the Continue button. This field is read-only.

Properties

AccessKey

Gets or sets the access key that allows you to quickly navigate to the Web server control.

(Inherited from WebControl)
Adapter

Gets the browser-specific adapter for the control.

(Inherited from Control)
AppRelativeTemplateSourceDirectory

Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(Inherited from Control)
Attributes

Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.

(Inherited from WebControl)
BackColor

Gets or sets the background color of the Web server control.

(Inherited from WebControl)
BindingContainer

Gets the control that contains this control's data binding.

(Inherited from Control)
BorderColor

Gets or sets the border color of the Web control.

(Inherited from WebControl)
BorderPadding

Gets or sets the amount of padding, in pixels, inside the border and the designated area for the ChangePassword control.

BorderStyle

Gets or sets the border style of the Web server control.

(Inherited from WebControl)
BorderWidth

Gets or sets the border width of the Web server control.

(Inherited from WebControl)
CancelButtonImageUrl

Gets or sets the URL of an image to display with the Cancel button, if the Cancel button is configured by the CancelButtonType property to be an image button.

CancelButtonStyle

Gets a reference to a collection of Style properties that define the appearance of the Cancel button on the ChangePassword control.

CancelButtonText

Gets or sets the text displayed on the Cancel button.

CancelButtonType

Gets or sets the type of button to use for the Cancel button when rendering the ChangePassword control.

CancelDestinationPageUrl

Gets or sets the URL of the page that the user is shown after clicking the Cancel button in the ChangePassword control.

ChangePasswordButtonImageUrl

Gets or sets the URL of an image displayed next to the Change Password button on the ChangePassword control if the Change Password button is configured by the ChangePasswordButtonType property to be an image button.

ChangePasswordButtonStyle

Gets a reference to a collection of Style properties that define the appearance of the Change Password button on the ChangePassword control.

ChangePasswordButtonText

Gets or sets the text displayed on the Change Password button.

ChangePasswordButtonType

Gets or sets the type of button to use when rendering the Change Password button of the ChangePassword control.

ChangePasswordFailureText

Gets or sets the message that is shown when the user's password is not changed.

ChangePasswordTemplate

Gets or sets the ITemplate object used to display the Change Password view of the ChangePassword control.

ChangePasswordTemplateContainer

Gets the container that a ChangePassword control uses to create an instance of the ChangePasswordTemplate template. This provides programmatic access to child controls.

ChangePasswordTitleText

Gets or sets the text displayed at the top of the ChangePassword control in Change Password view.

ChildControlsCreated

Gets a value that indicates whether the server control's child controls have been created.

(Inherited from Control)
ClientID

Gets the control ID for HTML markup that is generated by ASP.NET.

(Inherited from Control)
ClientIDMode

Gets or sets the algorithm that is used to generate the value of the ClientID property.

(Inherited from Control)
ClientIDSeparator

Gets a character value representing the separator character used in the ClientID property.

(Inherited from Control)
ConfirmNewPassword

Gets the duplicate password entered by the user.

ConfirmNewPasswordLabelText

Gets or sets the label text for the ConfirmNewPassword text box.

ConfirmPasswordCompareErrorMessage

Gets or sets the message that is displayed when the new password and the duplicate password entered by the user are not identical.

ConfirmPasswordRequiredErrorMessage

Gets or sets the error message that is displayed when the Confirm New Password text box is left empty.

Context

Gets the HttpContext object associated with the server control for the current Web request.

(Inherited from Control)
ContinueButtonImageUrl

Gets or sets the URL of an image to use for the Continue button on the Success view of the ChangePassword control if the Continue button is configured by the ContinueButtonType property to be an image button.

ContinueButtonStyle

Gets a reference to a collection of Style properties that define the appearance of the Continue button on the Success view of the ChangePassword control.

ContinueButtonText

Gets or sets the text that is displayed on the Continue button on the Success view of the ChangePassword control.

ContinueButtonType

Gets or sets the type of button to use when rendering the Continue button for the ChangePassword control.

ContinueDestinationPageUrl

Gets or sets the URL of the page that the user will see after clicking the Continue button on the Success view.

Controls

Gets a ControlCollection object that represents the child controls in a CompositeControl.

(Inherited from CompositeControl)
ControlStyle

Gets the style of the Web server control. This property is used primarily by control developers.

(Inherited from WebControl)
ControlStyleCreated

Gets a value indicating whether a Style object has been created for the ControlStyle property. This property is primarily used by control developers.

(Inherited from WebControl)
CreateUserIconUrl

Gets or sets the URL of an image to display next to the link to the Web page that contains a CreateUserWizard control for the Web site.

CreateUserText

Gets or sets the text of the link to the Web page that contains a CreateUserWizard control for the Web site.

CreateUserUrl

Gets or sets the URL of the Web page that contains a CreateUserWizard control for the Web site.

CssClass

Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

(Inherited from WebControl)
CurrentPassword

Gets the current password for the user.

DataItemContainer

Gets a reference to the naming container if the naming container implements IDataItemContainer.

(Inherited from Control)
DataKeysContainer

Gets a reference to the naming container if the naming container implements IDataKeysControl.

(Inherited from Control)
DesignMode

Gets a value indicating whether a control is being used on a design surface.

(Inherited from Control)
DisplayUserName

Gets or sets a value indicating whether the ChangePassword control should display the UserName control and label.

EditProfileIconUrl

Gets or sets the URL of an image to display next to the link to the user profile editing page for the Web site.

EditProfileText

Gets or sets the text of the link to the user profile editing page for the Web site.

EditProfileUrl

Gets or sets the URL of the user profile editing page for the Web site.

Enabled

Gets or sets a value indicating whether the Web server control is enabled.

(Inherited from WebControl)
EnableTheming

Gets or sets a value indicating whether themes apply to this control.

(Inherited from WebControl)
EnableViewState

Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(Inherited from Control)
Events

Gets a list of event handler delegates for the control. This property is read-only.

(Inherited from Control)
FailureTextStyle

Gets a reference to a collection of Style properties that define the appearance of error messages on the ChangePassword control.

Font

Gets the font properties associated with the Web server control.

(Inherited from WebControl)
ForeColor

Gets or sets the foreground color (typically the color of the text) of the Web server control.

(Inherited from WebControl)
HasAttributes

Gets a value indicating whether the control has attributes set.

(Inherited from WebControl)
HasChildViewState

Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(Inherited from Control)
Height

Gets or sets the height of the Web server control.

(Inherited from WebControl)
HelpPageIconUrl

Gets or sets the URL of an image to display next to the Change Password help page for the Web site.

HelpPageText

Gets or sets the link text to the Change Password help page for the Web site.

HelpPageUrl

Gets or sets the URL of the Change Password help page for the Web site.

HyperLinkStyle

Gets a reference to a collection of Style properties that define the appearance of hyperlinks on the ChangePassword control.

ID

Gets or sets the programmatic identifier assigned to the server control.

(Inherited from Control)
IdSeparator

Gets the character used to separate control identifiers.

(Inherited from Control)
InstructionText

Gets or sets informational text that appears on the ChangePassword control between the ChangePasswordTitleText and the input boxes.

InstructionTextStyle

Gets a reference to a collection of Style properties that define the appearance of the instructional text on the ChangePassword control.

IsChildControlStateCleared

Gets a value indicating whether controls contained within this control have control state.

(Inherited from Control)
IsEnabled

Gets a value indicating whether the control is enabled.

(Inherited from WebControl)
IsTrackingViewState

Gets a value that indicates whether the server control is saving changes to its view state.

(Inherited from Control)
IsViewStateEnabled

Gets a value indicating whether view state is enabled for this control.

(Inherited from Control)
LabelStyle

Gets a reference to a collection of Style objects that define the appearance of text box labels on the ChangePassword control.

LoadViewStateByID

Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(Inherited from Control)
MailDefinition

Gets a reference to a collection of properties that define the email message that is sent to users after they have changed their password.

MembershipProvider

Gets or sets the membership provider that is used to manage member information.

NamingContainer

Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(Inherited from Control)
NewPassword

Gets the new password entered by the user.

NewPasswordLabelText

Gets or sets the label text for the New Password text box.

NewPasswordRegularExpression

Gets or sets the regular expression that is used to validate the password provided by the user.

NewPasswordRegularExpressionErrorMessage

Gets or sets the error message that is shown when the password entered does not pass the regular expression criteria defined in the NewPasswordRegularExpression property.

NewPasswordRequiredErrorMessage

Gets or sets the error message that is displayed when the user leaves the New Password text box empty.

Page

Gets a reference to the Page instance that contains the server control.

(Inherited from Control)
Parent

Gets a reference to the server control's parent control in the page control hierarchy.

(Inherited from Control)
PasswordHintStyle

Gets a reference to a collection of Style properties that define the appearance of hint text that appears on the ChangePassword control.

PasswordHintText

Gets or sets informational text about the requirements for creating a password for the Web site.

PasswordLabelText

Gets or sets the label text for the Current Password text box.

PasswordRecoveryIconUrl

Gets or sets the URL of an image to display next to a link to the Web page that contains the PasswordRecovery control.

PasswordRecoveryText

Gets or sets the text of the link to the Web page that contains the PasswordRecovery control.

PasswordRecoveryUrl

Gets or sets the URL of the Web page that contains the PasswordRecovery control.

PasswordRequiredErrorMessage

Gets or sets the error message that is displayed when the user leaves the Current Password text box empty.

RenderingCompatibility

Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(Inherited from Control)
RenderOuterTable

Gets or sets a value that indicates whether the control encloses rendered HTML in a table element in order to apply inline styles.

Site

Gets information about the container that hosts the current control when rendered on a design surface.

(Inherited from Control)
SkinID

Gets or sets the skin to apply to the control.

(Inherited from WebControl)
Style

Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control.

(Inherited from WebControl)
SuccessPageUrl

Gets or sets the URL of the page that is shown to users after they have changed their password successfully.

SuccessTemplate

Gets or sets the ITemplate object that is used to display the Success and Change Password views of the ChangePassword control.

SuccessTemplateContainer

Gets the container that a ChangePassword control used to create an instance of the SuccessTemplate template. This provides programmatic access to child controls.

SuccessText

Gets or sets the text that is displayed on the Success view between the SuccessTitleText and the Continue button.

SuccessTextStyle

Gets a collection of Style properties that define the appearance of text on the Success view.

SuccessTitleText

Gets or sets the title of the Success view.

SupportsDisabledAttribute

Gets a value that indicates whether the control should set the disabled attribute of the rendered HTML element to "disabled" when the control's IsEnabled property is false.

(Inherited from CompositeControl)
TabIndex

Gets or sets the tab index of the Web server control.

(Inherited from WebControl)
TagKey

Gets the HtmlTextWriterTag value that corresponds to a ChangePassword control. This property is used primarily by control developers.

TagName

Gets the name of the control tag. This property is used primarily by control developers.

(Inherited from WebControl)
TemplateControl

Gets or sets a reference to the template that contains this control.

(Inherited from Control)
TemplateSourceDirectory

Gets the virtual directory of the Page or UserControl that contains the current server control.

(Inherited from Control)
TextBoxStyle

Gets a reference to a collection of Style properties that define the appearance of text box controls on the ChangePassword control.

TitleTextStyle

Gets a reference to a collection of Style properties that define the appearance of titles on the ChangePassword control.

ToolTip

Gets or sets the text displayed when the mouse pointer hovers over the Web server control.

(Inherited from WebControl)
UniqueID

Gets the unique, hierarchically qualified identifier for the server control.

(Inherited from Control)
UserName

Gets or sets the Web site user name for which to change the password.

UserNameLabelText

Gets or sets the label for the User Name text box.

UserNameRequiredErrorMessage

Gets or sets the error message that is displayed when the user leaves the User Name text box empty.

ValidateRequestMode

Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(Inherited from Control)
ValidatorTextStyle

Gets a reference to a collection of Style properties that define the appearance of error messages that are associated with any input validation used by the ChangePassword control.

ViewState

Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(Inherited from Control)
ViewStateIgnoresCase

Gets a value that indicates whether the StateBag object is case-insensitive.

(Inherited from Control)
ViewStateMode

Gets or sets the view-state mode of this control.

(Inherited from Control)
Visible

Gets or sets a value that indicates whether a server control is rendered as UI on the page.

(Inherited from Control)
Width

Gets or sets the width of the Web server control.

(Inherited from WebControl)

Methods

AddAttributesToRender(HtmlTextWriter)

Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. This method is used primarily by control developers.

(Inherited from WebControl)
AddedControl(Control, Int32)

Called after a child control is added to the Controls collection of the Control object.

(Inherited from Control)
AddParsedSubObject(Object)

Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(Inherited from Control)
ApplyStyle(Style)

Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. This method is primarily used by control developers.

(Inherited from WebControl)
ApplyStyleSheetSkin(Page)

Applies the style properties defined in the page style sheet to the control.

(Inherited from Control)
BeginRenderTracing(TextWriter, Object)

Begins design-time tracing of rendering data.

(Inherited from Control)
BuildProfileTree(String, Boolean)

Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(Inherited from Control)
ClearCachedClientID()

Sets the cached ClientID value to null.

(Inherited from Control)
ClearChildControlState()

Deletes the control-state information for the server control's child controls.

(Inherited from Control)
ClearChildState()

Deletes the view-state and control-state information for all the server control's child controls.

(Inherited from Control)
ClearChildViewState()

Deletes the view-state information for all the server control's child controls.

(Inherited from Control)
ClearEffectiveClientIDMode()

Sets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(Inherited from Control)
CopyBaseAttributes(WebControl)

Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. This method is used primarily by control developers.

(Inherited from WebControl)
CreateChildControls()

Creates the individual controls that make up the ChangePassword control in preparation for posting back or rendering.

CreateControlCollection()

Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control.

(Inherited from Control)
CreateControlStyle()

Creates the style object that is used internally by the WebControl class to implement all style related properties. This method is used primarily by control developers.

(Inherited from WebControl)
DataBind()

Binds a data source to the CompositeControl and all its child controls.

(Inherited from CompositeControl)
DataBind(Boolean)

Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(Inherited from Control)
DataBindChildren()

Binds a data source to the server control's child controls.

(Inherited from Control)
Dispose()

Enables a server control to perform final clean up before it is released from memory.

(Inherited from Control)
EndRenderTracing(TextWriter, Object)

Ends design-time tracing of rendering data.

(Inherited from Control)
EnsureChildControls()

Determines whether the server control contains child controls. If it does not, it creates child controls.

(Inherited from Control)
EnsureID()

Creates an identifier for controls that do not have an identifier assigned.

(Inherited from Control)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindControl(String, Int32)

Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. You should not override this version of the FindControl method.

(Inherited from Control)
FindControl(String)

Searches the current naming container for a server control with the specified id parameter.

(Inherited from Control)
Focus()

Sets input focus to a control.

(Inherited from Control)
GetDesignModeState()

Gets design-time data for a control.

(Inherited from Control)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRouteUrl(Object)

Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(RouteValueDictionary)

Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(String, Object)

Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetRouteUrl(String, RouteValueDictionary)

Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetUniqueIDRelativeTo(Control)

Returns the prefixed portion of the UniqueID property of the specified control.

(Inherited from Control)
HasControls()

Determines if the server control contains any child controls.

(Inherited from Control)
HasEvents()

Returns a value indicating whether events are registered for the control or any child controls.

(Inherited from Control)
IsLiteralContent()

Determines if the server control holds only literal content.

(Inherited from Control)
LoadControlState(Object)

Restores control state information from a previous page request that was saved by the SaveControlState() method.

LoadViewState(Object)

Restores view state information from a previous page request that was saved by the SaveViewState() method.

MapPathSecure(String)

Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(Inherited from Control)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MergeStyle(Style)

Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. This method is used primarily by control developers.

(Inherited from WebControl)
OnBubbleEvent(Object, EventArgs)

Determines whether the event for the ChangePassword control is passed up the Web server control hierarchy for the page.

OnCancelButtonClick(EventArgs)

Raises the CancelButtonClick event when a user clicks the Cancel button.

OnChangedPassword(EventArgs)

Raises the ChangedPassword event after the password is changed.

OnChangePasswordError(EventArgs)

Raises the ChangePasswordError event when the user's password is not changed.

OnChangingPassword(LoginCancelEventArgs)

Raises the ChangingPassword event before the user's password is changed by the membership provider.

OnContinueButtonClick(EventArgs)

Raises the ContinueButtonClick event when a user clicks the Continue button.

OnDataBinding(EventArgs)

Raises the DataBinding event.

(Inherited from Control)
OnInit(EventArgs)

Raises the Init event for the ChangePassword control to allow the control to register itself with the page.

OnLoad(EventArgs)

Raises the Load event.

(Inherited from Control)
OnPreRender(EventArgs)

Raises the PreRender event.

OnSendingMail(MailMessageEventArgs)

Raises the SendingMail event before an email message is sent to the SMTP server for processing. The SMTP server then sends the email message to the user.

OnSendMailError(SendMailErrorEventArgs)

Raises the SendMailError event when an email message cannot be sent to the user.

OnUnload(EventArgs)

Raises the Unload event.

(Inherited from Control)
OpenFile(String)

Gets a Stream used to read a file.

(Inherited from Control)
RaiseBubbleEvent(Object, EventArgs)

Assigns any sources of the event and its information to the control's parent.

(Inherited from Control)
RecreateChildControls()

Recreates the child controls in a control derived from CompositeControl.

(Inherited from CompositeControl)
RemovedControl(Control)

Called after a child control is removed from the Controls collection of the Control object.

(Inherited from Control)
Render(HtmlTextWriter)

Writes the ChangePassword control content to the specified HtmlTextWriter object, for display on the client.

RenderBeginTag(HtmlTextWriter)

Renders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers.

(Inherited from WebControl)
RenderChildren(HtmlTextWriter)

Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(Inherited from Control)
RenderContents(HtmlTextWriter)

Renders the contents of the control to the specified writer. This method is used primarily by control developers.

(Inherited from WebControl)
RenderControl(HtmlTextWriter, ControlAdapter)

Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(Inherited from Control)
RenderControl(HtmlTextWriter)

Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(Inherited from Control)
RenderEndTag(HtmlTextWriter)

Renders the HTML closing tag of the control into the specified writer. This method is used primarily by control developers.

(Inherited from WebControl)
ResolveAdapter()

Gets the control adapter responsible for rendering the specified control.

(Inherited from Control)
ResolveClientUrl(String)

Gets a URL that can be used by the browser.

(Inherited from Control)
ResolveUrl(String)

Converts a URL into one that is usable on the requesting client.

(Inherited from Control)
SaveControlState()

Saves any server control state changes that have occurred since the time the page was posted back to the server.

SaveViewState()

Saves any server control view state changes that have occurred since the time the page was posted back to the server.

SetDesignModeState(IDictionary)

Sets design-time data for a control.

SetRenderMethodDelegate(RenderMethod)

Assigns an event handler delegate to render the server control and its content into its parent control.

(Inherited from Control)
SetTraceData(Object, Object, Object)

Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(Inherited from Control)
SetTraceData(Object, Object)

Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(Inherited from Control)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrackViewState()

Causes tracking of view-state changes to the server control so that they can be stored in the server control's StateBag object. This object is accessible through the ViewState property.

Events

CancelButtonClick

Occurs when the user clicks the Cancel button to cancel changing a password.

ChangedPassword

Occurs when the password is changed for a user account.

ChangePasswordError

Occurs when there is an error changing the password for the user account.

ChangingPassword

Occurs before the password for a user account is changed by the membership provider.

ContinueButtonClick

Raises the ContinueButtonClick event when the user clicks the Continue button.

DataBinding

Occurs when the server control binds to a data source.

(Inherited from Control)
Disposed

Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(Inherited from Control)
Init

Occurs when the server control is initialized, which is the first step in its lifecycle.

(Inherited from Control)
Load

Occurs when the server control is loaded into the Page object.

(Inherited from Control)
PreRender

Occurs after the Control object is loaded but prior to rendering.

(Inherited from Control)
SendingMail

Occurs before the user is sent an email confirmation that the password has been changed.

SendMailError

Occurs when there is an SMTP error sending an email message to the user.

Unload

Occurs when the server control is unloaded from memory.

(Inherited from Control)

Explicit Interface Implementations

IAttributeAccessor.GetAttribute(String)

Gets an attribute of the Web control with the specified name.

(Inherited from WebControl)
IAttributeAccessor.SetAttribute(String, String)

Sets an attribute of the Web control to the specified name and value.

(Inherited from WebControl)
ICompositeControlDesignerAccessor.RecreateChildControls()

Enables a designer to recreate the composite control's collection of child controls in the design-time environment.

(Inherited from CompositeControl)
IControlBuilderAccessor.ControlBuilder

For a description of this member, see ControlBuilder.

(Inherited from Control)
IControlDesignerAccessor.GetDesignModeState()

For a description of this member, see GetDesignModeState().

(Inherited from Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

For a description of this member, see SetDesignModeState(IDictionary).

(Inherited from Control)
IControlDesignerAccessor.SetOwnerControl(Control)

For a description of this member, see SetOwnerControl(Control).

(Inherited from Control)
IControlDesignerAccessor.UserData

For a description of this member, see UserData.

(Inherited from Control)
IDataBindingsAccessor.DataBindings

For a description of this member, see DataBindings.

(Inherited from Control)
IDataBindingsAccessor.HasDataBindings

For a description of this member, see HasDataBindings.

(Inherited from Control)
IExpressionsAccessor.Expressions

For a description of this member, see Expressions.

(Inherited from Control)
IExpressionsAccessor.HasExpressions

For a description of this member, see HasExpressions.

(Inherited from Control)
IParserAccessor.AddParsedSubObject(Object)

For a description of this member, see AddParsedSubObject(Object).

(Inherited from Control)

Extension Methods

FindDataSourceControl(Control)

Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String)

Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control)

Returns the metatable object for the containing data control.

GetDefaultValues(INamingContainer)

Gets the collection of the default values for the specified data control.

GetMetaTable(INamingContainer)

Gets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable, Object)

Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable)

Sets the table metadata for the specified data control.

TryGetMetaTable(INamingContainer, MetaTable)

Determines whether table metadata is available.

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, Object)

Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type)

Enables Dynamic Data behavior for the specified data control.

Applies to

See also