Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

ChangePassword Class

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
[BindableAttribute(false)]
public class ChangePassword : CompositeControl, 
	INamingContainer
<asp:ChangePassword />

The ChangePassword type exposes the following members.

  NameDescription
Public methodChangePasswordInitializes a new instance of the ChangePassword class.
Top
  NameDescription
Public propertyAccessKeyGets or sets the access key that allows you to quickly navigate to the Web server control. (Inherited from WebControl.)
Protected propertyAdapterGets the browser-specific adapter for the control. (Inherited from Control.)
Public propertyAppRelativeTemplateSourceDirectoryGets or sets the application-relative virtual directory of the Page or UserControl object that contains this control. (Inherited from Control.)
Public propertyAttributesGets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control. (Inherited from WebControl.)
Public propertyBackColorGets or sets the background color of the Web server control. (Inherited from WebControl.)
Public propertyBindingContainerInfrastructure. Gets the control that contains this control's data binding. (Inherited from Control.)
Public propertyBorderColorGets or sets the border color of the Web control. (Inherited from WebControl.)
Public propertyBorderPaddingGets or sets the amount of padding, in pixels, inside the border and the designated area for the ChangePassword control.
Public propertyBorderStyleGets or sets the border style of the Web server control. (Inherited from WebControl.)
Public propertyBorderWidthGets or sets the border width of the Web server control. (Inherited from WebControl.)
Public propertyCancelButtonImageUrlGets 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.
Public propertyCancelButtonStyleGets a reference to a collection of Style properties that define the appearance of the Cancel button on the ChangePassword control.
Public propertyCancelButtonTextGets or sets the text displayed on the Cancel button.
Public propertyCancelButtonTypeGets or sets the type of button to use for the Cancel button when rendering the ChangePassword control.
Public propertyCancelDestinationPageUrlGets or sets the URL of the page that the user is shown after clicking the Cancel button in the ChangePassword control.
Public propertyChangePasswordButtonImageUrlGets 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.
Public propertyChangePasswordButtonStyleGets a reference to a collection of Style properties that define the appearance of the Change Password button on the ChangePassword control.
Public propertyChangePasswordButtonTextGets or sets the text displayed on the Change Password button.
Public propertyChangePasswordButtonTypeGets or sets the type of button to use when rendering the Change Password button of the ChangePassword control.
Public propertyChangePasswordFailureTextGets or sets the message that is shown when the user's password is not changed.
Public propertyChangePasswordTemplateGets or sets the ITemplate object used to display the Change Password view of the ChangePassword control.
Public propertyChangePasswordTemplateContainerGets the container that a ChangePassword control uses to create an instance of the ChangePasswordTemplate template. This provides programmatic access to child controls.
Public propertyChangePasswordTitleTextGets or sets the text displayed at the top of the ChangePassword control in Change Password view.
Protected propertyChildControlsCreatedGets a value that indicates whether the server control's child controls have been created. (Inherited from Control.)
Public propertyClientIDGets the control ID for HTML markup that is generated by ASP.NET. (Inherited from Control.)
Public propertyClientIDModeGets or sets the algorithm that is used to generate the value of the ClientID property. (Inherited from Control.)
Protected propertyClientIDSeparatorGets a character value representing the separator character used in the ClientID property. (Inherited from Control.)
Public propertyConfirmNewPasswordGets the duplicate password entered by the user.
Public propertyConfirmNewPasswordLabelTextGets or sets the label text for the ConfirmNewPassword text box.
Public propertyConfirmPasswordCompareErrorMessageGets or sets the message that is displayed when the new password and the duplicate password entered by the user are not identical.
Public propertyConfirmPasswordRequiredErrorMessageGets or sets the error message that is displayed when the Confirm New Password text box is left empty.
Protected propertyContextGets the HttpContext object associated with the server control for the current Web request. (Inherited from Control.)
Public propertyContinueButtonImageUrlGets 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.
Public propertyContinueButtonStyleGets a reference to a collection of Style properties that define the appearance of the Continue button on the Success view of the ChangePassword control.
Public propertyContinueButtonTextGets or sets the text that is displayed on the Continue button on the Success view of the ChangePassword control.
Public propertyContinueButtonTypeGets or sets the type of button to use when rendering the Continue button for the ChangePassword control.
Public propertyContinueDestinationPageUrlGets or sets the URL of the page that the user will see after clicking the Continue button on the Success view.
Public propertyControlsGets a ControlCollection object that represents the child controls in a CompositeControl. (Inherited from CompositeControl.)
Public propertyControlStyleGets the style of the Web server control. This property is used primarily by control developers. (Inherited from WebControl.)
Public propertyControlStyleCreatedGets 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.)
Public propertyCreateUserIconUrlGets 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.
Public propertyCreateUserTextGets or sets the text of the link to the Web page that contains a CreateUserWizard control for the Web site.
Public propertyCreateUserUrlGets or sets the URL of the Web page that contains a CreateUserWizard control for the Web site.
Public propertyCssClassGets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client. (Inherited from WebControl.)
Public propertyCurrentPasswordGets the current password for the user.
Public propertyDataItemContainerGets a reference to the naming container if the naming container implements IDataItemContainer. (Inherited from Control.)
Public propertyDataKeysContainerGets a reference to the naming container if the naming container implements IDataKeysControl. (Inherited from Control.)
Protected propertyDesignModeGets a value indicating whether a control is being used on a design surface. (Inherited from Control.)
Public propertyDisplayUserNameGets or sets a value indicating whether the ChangePassword control should display the UserName control and label.
Public propertyEditProfileIconUrlGets or sets the URL of an image to display next to the link to the user profile editing page for the Web site.
Public propertyEditProfileTextGets or sets the text of the link to the user profile editing page for the Web site.
Public propertyEditProfileUrlGets or sets the URL of the user profile editing page for the Web site.
Public propertyEnabledGets or sets a value indicating whether the Web server control is enabled. (Inherited from WebControl.)
Public propertyEnableThemingGets or sets a value indicating whether themes apply to this control. (Inherited from WebControl.)
Public propertyEnableViewStateGets 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.)
Protected propertyEventsGets a list of event handler delegates for the control. This property is read-only. (Inherited from Control.)
Public propertyFailureTextStyleGets a reference to a collection of Style properties that define the appearance of error messages on the ChangePassword control.
Public propertyFontGets the font properties associated with the Web server control. (Inherited from WebControl.)
Public propertyForeColorGets or sets the foreground color (typically the color of the text) of the Web server control. (Inherited from WebControl.)
Public propertyHasAttributesGets a value indicating whether the control has attributes set. (Inherited from WebControl.)
Protected propertyHasChildViewStateGets a value indicating whether the current server control's child controls have any saved view-state settings. (Inherited from Control.)
Public propertyHeightGets or sets the height of the Web server control. (Inherited from WebControl.)
Public propertyHelpPageIconUrlGets or sets the URL of an image to display next to the Change Password help page for the Web site.
Public propertyHelpPageTextGets or sets the link text to the Change Password help page for the Web site.
Public propertyHelpPageUrlGets or sets the URL of the Change Password help page for the Web site.
Public propertyHyperLinkStyleGets a reference to a collection of Style properties that define the appearance of hyperlinks on the ChangePassword control.
Public propertyIDGets or sets the programmatic identifier assigned to the server control. (Inherited from Control.)
Protected propertyIdSeparatorInfrastructure. Gets the character used to separate control identifiers. (Inherited from Control.)
Public propertyInstructionTextGets or sets informational text that appears on the ChangePassword control between the ChangePasswordTitleText and the input boxes.
Public propertyInstructionTextStyleGets a reference to a collection of Style properties that define the appearance of the instructional text on the ChangePassword control.
Protected propertyIsChildControlStateClearedGets a value indicating whether controls contained within this control have control state. (Inherited from Control.)
Protected propertyIsEnabledGets a value indicating whether the control is enabled. (Inherited from WebControl.)
Protected propertyIsTrackingViewStateGets a value that indicates whether the server control is saving changes to its view state. (Inherited from Control.)
Protected propertyIsViewStateEnabledGets a value indicating whether view state is enabled for this control. (Inherited from Control.)
Public propertyLabelStyleGets a reference to a collection of Style objects that define the appearance of text box labels on the ChangePassword control.
Protected propertyLoadViewStateByIDGets a value indicating whether the control participates in loading its view state by ID instead of index. (Inherited from Control.)
Public propertyMailDefinitionGets a reference to a collection of properties that define the e-mail message that is sent to users after they have changed their password.
Public propertyMembershipProviderGets or sets the membership provider that is used to manage member information.
Public propertyNamingContainerGets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same Control.ID property value. (Inherited from Control.)
Public propertyNewPasswordGets the new password entered by the user.
Public propertyNewPasswordLabelTextGets or sets the label text for the New Password text box.
Public propertyNewPasswordRegularExpressionGets or sets the regular expression that is used to validate the password provided by the user.
Public propertyNewPasswordRegularExpressionErrorMessageGets or sets the error message that is shown when the password entered does not pass the regular expression criteria defined in the NewPasswordRegularExpression property.
Public propertyNewPasswordRequiredErrorMessageGets or sets the error message that is displayed when the user leaves the New Password text box empty.
Public propertyPageGets a reference to the Page instance that contains the server control. (Inherited from Control.)
Public propertyParentGets a reference to the server control's parent control in the page control hierarchy. (Inherited from Control.)
Public propertyPasswordHintStyleGets a reference to a collection of Style properties that define the appearance of hint text that appears on the ChangePassword control.
Public propertyPasswordHintTextGets or sets informational text about the requirements for creating a password for the Web site.
Public propertyPasswordLabelTextGets or sets the label text for the Current Password text box.
Public propertyPasswordRecoveryIconUrlGets or sets the URL of an image to display next to a link to the Web page that contains the PasswordRecovery control.
Public propertyPasswordRecoveryTextGets or sets the text of the link to the Web page that contains the PasswordRecovery control.
Public propertyPasswordRecoveryUrlGets or sets the URL of the Web page that contains the PasswordRecovery control.
Public propertyPasswordRequiredErrorMessageGets or sets the error message that is displayed when the user leaves the Current Password text box empty.
Public propertyRenderingCompatibilityGets a value that specifies the ASP.NET version that rendered HTML will be compatible with. (Inherited from Control.)
Public propertyRenderOuterTableGets or sets a value that indicates whether the control encloses rendered HTML in a table element in order to apply inline styles.
Public propertySiteGets information about the container that hosts the current control when rendered on a design surface. (Inherited from Control.)
Public propertySkinIDGets or sets the skin to apply to the control. (Inherited from WebControl.)
Public propertyStyleGets 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.)
Public propertySuccessPageUrlGets or sets the URL of the page that is shown to users after they have changed their password successfully.
Public propertySuccessTemplateGets or sets the ITemplate object that is used to display the Success and Change Password views of the ChangePassword control.
Public propertySuccessTemplateContainerGets the container that a ChangePassword control used to create an instance of the SuccessTemplate template. This provides programmatic access to child controls.
Public propertySuccessTextGets or sets the text that is displayed on the Success view between the SuccessTitleText and the Continue button.
Public propertySuccessTextStyleGets a collection of Style properties that define the appearance of text on the Success view.
Public propertySuccessTitleTextGets or sets the title of the Success view.
Public propertySupportsDisabledAttributeGets 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.)
Public propertyTabIndexGets or sets the tab index of the Web server control. (Inherited from WebControl.)
Protected propertyTagKeyGets the HtmlTextWriterTag value that corresponds to a ChangePassword control. This property is used primarily by control developers. (Overrides WebControl.TagKey.)
Protected propertyTagNameGets the name of the control tag. This property is used primarily by control developers. (Inherited from WebControl.)
Public propertyTemplateControlGets or sets a reference to the template that contains this control. (Inherited from Control.)
Public propertyTemplateSourceDirectoryGets the virtual directory of the Page or UserControl that contains the current server control. (Inherited from Control.)
Public propertyTextBoxStyleGets a reference to a collection of Style properties that define the appearance of text box controls on the ChangePassword control.
Public propertyTitleTextStyleGets a reference to a collection of Style properties that define the appearance of titles on the ChangePassword control.
Public propertyToolTipGets or sets the text displayed when the mouse pointer hovers over the Web server control. (Inherited from WebControl.)
Public propertyUniqueIDGets the unique, hierarchically qualified identifier for the server control. (Inherited from Control.)
Public propertyUserNameGets or sets the Web site user name for which to change the password.
Public propertyUserNameLabelTextGets or sets the label for the User Name text box.
Public propertyUserNameRequiredErrorMessageGets or sets the error message that is displayed when the user leaves the User Name text box empty.
Public propertyValidateRequestModeGets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values. (Inherited from Control.)
Public propertyValidatorTextStyleGets 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.
Protected propertyViewStateGets 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.)
Protected propertyViewStateIgnoresCaseGets a value that indicates whether the StateBag object is case-insensitive. (Inherited from Control.)
Public propertyViewStateModeGets or sets the view-state mode of this control. (Inherited from Control.)
Public propertyVisibleGets or sets a value that indicates whether a server control is rendered as UI on the page. (Inherited from Control.)
Public propertyWidthGets or sets the width of the Web server control. (Inherited from WebControl.)
Top
  NameDescription
Protected methodAddAttributesToRenderAdds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodAddedControlCalled after a child control is added to the Controls collection of the Control object. (Inherited from Control.)
Protected methodAddParsedSubObjectNotifies 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.)
Public methodApplyStyleCopies 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.)
Public methodApplyStyleSheetSkinApplies the style properties defined in the page style sheet to the control. (Inherited from Control.)
Protected methodBeginRenderTracingBegins design-time tracing of rendering data. (Inherited from Control.)
Protected methodBuildProfileTreeInfrastructure. 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.)
Protected methodClearCachedClientIDInfrastructure. Sets the cached ClientID value to null. (Inherited from Control.)
Protected methodClearChildControlStateDeletes the control-state information for the server control's child controls. (Inherited from Control.)
Protected methodClearChildStateDeletes the view-state and control-state information for all the server control's child controls. (Inherited from Control.)
Protected methodClearChildViewStateDeletes the view-state information for all the server control's child controls. (Inherited from Control.)
Protected methodClearEffectiveClientIDModeInfrastructure. Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (Inherited from Control.)
Public methodCopyBaseAttributesCopies 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.)
Protected methodCreateChildControlsCreates the individual controls that make up the ChangePassword control in preparation for posting back or rendering. (Overrides Control.CreateChildControls().)
Protected methodCreateControlCollectionCreates a new ControlCollection object to hold the child controls (both literal and server) of the server control. (Inherited from Control.)
Protected methodCreateControlStyleCreates 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.)
Public methodDataBind()Binds a data source to the CompositeControl and all its child controls. (Inherited from CompositeControl.)
Protected methodDataBind(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.)
Protected methodDataBindChildrenBinds a data source to the server control's child controls. (Inherited from Control.)
Public methodDisposeEnables a server control to perform final clean up before it is released from memory. (Inherited from Control.)
Protected methodEndRenderTracingEnds design-time tracing of rendering data. (Inherited from Control.)
Protected methodEnsureChildControlsDetermines whether the server control contains child controls. If it does not, it creates child controls. (Inherited from Control.)
Protected methodEnsureIDCreates an identifier for controls that do not have an identifier assigned. (Inherited from Control.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFindControl(String)Searches the current naming container for a server control with the specified id parameter. (Inherited from Control.)
Protected methodFindControl(String, Int32)Infrastructure. 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.)
Public methodFocusSets input focus to a control. (Inherited from Control.)
Protected methodGetDesignModeStateInfrastructure. Gets design-time data for a control. (Inherited from Control.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetRouteUrl(Object)Gets the URL that corresponds to a set of route parameters. (Inherited from Control.)
Public methodGetRouteUrl(RouteValueDictionary)Gets the URL that corresponds to a set of route parameters. (Inherited from Control.)
Public methodGetRouteUrl(String, Object)Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.)
Public methodGetRouteUrl(String, RouteValueDictionary)Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetUniqueIDRelativeToReturns the prefixed portion of the UniqueID property of the specified control. (Inherited from Control.)
Public methodHasControlsDetermines if the server control contains any child controls. (Inherited from Control.)
Protected methodHasEventsReturns a value indicating whether events are registered for the control or any child controls. (Inherited from Control.)
Protected methodIsLiteralContentInfrastructure. Determines if the server control holds only literal content. (Inherited from Control.)
Protected methodLoadControlStateRestores control state information from a previous page request that was saved by the SaveControlState method. (Overrides Control.LoadControlState(Object).)
Protected methodLoadViewStateRestores view state information from a previous page request that was saved by the SaveViewState method. (Overrides WebControl.LoadViewState(Object).)
Protected methodMapPathSecureRetrieves the physical path that a virtual path, either absolute or relative, maps to. (Inherited from Control.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMergeStyleCopies 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.)
Protected methodOnBubbleEventDetermines whether the event for the ChangePassword control is passed up the Web server control hierarchy for the page. (Overrides Control.OnBubbleEvent(Object, EventArgs).)
Protected methodOnCancelButtonClickRaises the CancelButtonClick event when a user clicks the Cancel button.
Protected methodOnChangedPasswordRaises the ChangedPassword event after the password is changed.
Protected methodOnChangePasswordErrorRaises the ChangePasswordError event when the user's password is not changed.
Protected methodOnChangingPasswordRaises the ChangingPassword event before the user's password is changed by the membership provider.
Protected methodOnContinueButtonClickRaises the ContinueButtonClick event when a user clicks the Continue button.
Protected methodOnDataBindingRaises the DataBinding event. (Inherited from Control.)
Protected methodOnInitRaises the Init event for the ChangePassword control to allow the control to register itself with the page. (Overrides Control.OnInit(EventArgs).)
Protected methodOnLoadRaises the Load event. (Inherited from Control.)
Protected methodOnPreRenderRaises the PreRender event. (Overrides Control.OnPreRender(EventArgs).)
Protected methodOnSendingMailRaises the SendingMail event before an e-mail message is sent to the SMTP server for processing. The SMTP server then sends the e-mail message to the user.
Protected methodOnSendMailErrorRaises the SendMailError event when an e-mail message cannot be sent to the user.
Protected methodOnUnloadRaises the Unload event. (Inherited from Control.)
Protected methodOpenFileGets a Stream used to read a file. (Inherited from Control.)
Protected methodRaiseBubbleEventAssigns any sources of the event and its information to the control's parent. (Inherited from Control.)
Protected methodRecreateChildControlsRecreates the child controls in a control derived from CompositeControl. (Inherited from CompositeControl.)
Protected methodRemovedControlCalled after a child control is removed from the Controls collection of the Control object. (Inherited from Control.)
Protected methodRenderInfrastructure. Writes the ChangePassword control content to the specified HtmlTextWriter object, for display on the client. (Overrides CompositeControl.Render(HtmlTextWriter).)
Public methodRenderBeginTagRenders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodRenderChildrenOutputs 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.)
Protected methodRenderContentsRenders the contents of the control to the specified writer. This method is used primarily by control developers. (Inherited from WebControl.)
Public methodRenderControl(HtmlTextWriter)Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. (Inherited from Control.)
Protected methodRenderControl(HtmlTextWriter, ControlAdapter)Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (Inherited from Control.)
Public methodRenderEndTagRenders the HTML closing tag of the control into the specified writer. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodResolveAdapterGets the control adapter responsible for rendering the specified control. (Inherited from Control.)
Public methodResolveClientUrlGets a URL that can be used by the browser. (Inherited from Control.)
Public methodResolveUrlConverts a URL into one that is usable on the requesting client. (Inherited from Control.)
Protected methodSaveControlStateSaves any server control state changes that have occurred since the time the page was posted back to the server. (Overrides Control.SaveControlState().)
Protected methodSaveViewStateSaves any server control view state changes that have occurred since the time the page was posted back to the server. (Overrides WebControl.SaveViewState().)
Protected methodSetDesignModeStateSets design-time data for a control. (Overrides Control.SetDesignModeState(IDictionary).)
Public methodSetRenderMethodDelegateInfrastructure. Assigns an event handler delegate to render the server control and its content into its parent control. (Inherited from Control.)
Public methodSetTraceData(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.)
Public methodSetTraceData(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.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTrackViewStateCauses 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 Control.ViewState property. (Overrides WebControl.TrackViewState().)
Top
  NameDescription
Public eventCancelButtonClickOccurs when the user clicks the Cancel button to cancel changing a password.
Public eventChangedPasswordOccurs when the password is changed for a user account.
Public eventChangePasswordErrorOccurs when there is an error changing the password for the user account.
Public eventChangingPasswordOccurs before the password for a user account is changed by the membership provider.
Public eventContinueButtonClickRaises the ContinueButtonClick event when the user clicks the Continue button.
Public eventDataBindingOccurs when the server control binds to a data source. (Inherited from Control.)
Public eventDisposedOccurs 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.)
Public eventInitOccurs when the server control is initialized, which is the first step in its lifecycle. (Inherited from Control.)
Public eventLoadOccurs when the server control is loaded into the Page object. (Inherited from Control.)
Public eventPreRenderOccurs after the Control object is loaded but prior to rendering. (Inherited from Control.)
Public eventSendingMailOccurs before the user is sent an e-mail confirmation that the password has been changed.
Public eventSendMailErrorOccurs when there is an SMTP error sending an e-mail message to the user.
Public eventUnloadOccurs when the server control is unloaded from memory. (Inherited from Control.)
Top
  NameDescription
Public Extension MethodEnableDynamicData(Type)Overloaded. Enables Dynamic Data behavior for the specified data control. (Defined by DataControlExtensions.)
Public Extension MethodEnableDynamicData(Type, Object)Overloaded. Enables Dynamic Data behavior for the specified data control. (Defined by DataControlExtensions.)
Public Extension MethodEnableDynamicData(Type, IDictionary<String, Object>)Overloaded. Enables Dynamic Data behavior for the specified data control. (Defined by DataControlExtensions.)
Public Extension MethodFindDataSourceControlReturns the data source that is associated with the data control for the specified control. (Defined by DynamicDataExtensions.)
Public Extension MethodFindFieldTemplateReturns the field template for the specified column in the specified control's naming container. (Defined by DynamicDataExtensions.)
Public Extension MethodFindMetaTableReturns the metatable object for the containing data control. (Defined by DynamicDataExtensions.)
Public Extension MethodGetDefaultValuesGets the collection of the default values for the specified data control. (Defined by DynamicDataExtensions.)
Public Extension MethodGetMetaTableGets the table metadata for the specified data control. (Defined by DynamicDataExtensions.)
Public Extension MethodSetMetaTable(MetaTable)Overloaded. Sets the table metadata for the specified data control. (Defined by DynamicDataExtensions.)
Public Extension MethodSetMetaTable(MetaTable, IDictionary<String, Object>)Overloaded. Sets the table metadata and default value mapping for the specified data control. (Defined by DynamicDataExtensions.)
Public Extension MethodSetMetaTable(MetaTable, Object)Overloaded. Sets the table metadata and default value mapping for the specified data control. (Defined by DynamicDataExtensions.)
Public Extension MethodTryGetMetaTableDetermines whether table metadata is available. (Defined by DynamicDataExtensions.)
Top
  NameDescription
Public fieldStatic memberCancelButtonCommandNameRepresents the CommandName value of the Cancel button. This field is read-only.
Public fieldStatic memberChangePasswordButtonCommandNameRepresents the CommandName value of the Change Password button. This field is read-only.
Public fieldStatic memberContinueButtonCommandNameRepresents CommandName value of the Continue button. This field is read-only.
Top
  NameDescription
Explicit interface implemetationPrivate methodIAttributeAccessor.GetAttributeInfrastructure. Gets an attribute of the Web control with the specified name. (Inherited from WebControl.)
Explicit interface implemetationPrivate methodIAttributeAccessor.SetAttributeSets an attribute of the Web control to the specified name and value. (Inherited from WebControl.)
Explicit interface implemetationPrivate methodICompositeControlDesignerAccessor.RecreateChildControlsEnables a designer to recreate the composite control's collection of child controls in the design-time environment. (Inherited from CompositeControl.)
Explicit interface implemetationPrivate propertyIControlBuilderAccessor.ControlBuilderFor a description of this member, see IControlBuilderAccessor.ControlBuilder. (Inherited from Control.)
Explicit interface implemetationPrivate methodIControlDesignerAccessor.GetDesignModeStateFor a description of this member, see IControlDesignerAccessor.GetDesignModeState. (Inherited from Control.)
Explicit interface implemetationPrivate methodIControlDesignerAccessor.SetDesignModeStateFor a description of this member, see IControlDesignerAccessor.SetDesignModeState. (Inherited from Control.)
Explicit interface implemetationPrivate methodIControlDesignerAccessor.SetOwnerControlInfrastructure. For a description of this member, see IControlDesignerAccessor.SetOwnerControl. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIControlDesignerAccessor.UserDataFor a description of this member, see IControlDesignerAccessor.UserData. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIDataBindingsAccessor.DataBindingsFor a description of this member, see IDataBindingsAccessor.DataBindings. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIDataBindingsAccessor.HasDataBindingsFor a description of this member, see IDataBindingsAccessor.HasDataBindings. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIExpressionsAccessor.ExpressionsFor a description of this member, see IExpressionsAccessor.Expressions. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIExpressionsAccessor.HasExpressionsFor a description of this member, see IExpressionsAccessor.HasExpressions. (Inherited from Control.)
Explicit interface implemetationPrivate methodIParserAccessor.AddParsedSubObjectFor a description of this member, see IParserAccessor.AddParsedSubObject. (Inherited from Control.)
Top

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.

NoteNote

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.

Security noteSecurity Note

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.

Security noteSecurity Note

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 E-mail Messages

The ChangePassword control can be configured to use e-mail services to send the new password to the user. To send e-mail messages to users from any of ASP.NET Web server controls, you must configure an e-mail 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.

E-mail messages are configured using the MailDefinition class. You must set the BodyFileName property to instruct ASP.NET to send e-mail.

Security noteSecurity Note

Sending user account names or passwords in e-mail is a potential security threat. E-mail 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.

NoteNote

It is not possible to guarantee that a user will receive or view an e-mail message. To verify that a user has received a message, provide a confirmation link in the e-mail 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 noteImportant

    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>

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.

NoteNote

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>

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.