ASP. NET-how to: Use the ASP. NET passwordrecovery control to enable user password recovery

Source: Internet
Author: User

If the applicationProgramUse ASP. NET Can be used for identity verification. Passwordrecovery Control to enable password restoration in this application. At this time, the application will send the user the current password or new password, depending on the configuration of the membership provisioner. By default, ASP. NET It will use an irreversible encryption scheme to hash the password and then send the new password to the user. If the membership provider is configured, the password can be encrypted or stored in plaintext (not recommended). The current password of the user will be sent.

To restore the password, the application must be able to send an email to the user. Therefore, you must useSMTPThe server name configures the application so that the application can forward emails to the server.

 

1 Create or edit a website that anonymous users can access ASP. NET Webpage (for example, Recoverpassword. aspx ). You can use Location The configuration element specifies that a page can be accessed anonymously, as shown in the following example:

<Configuration>

<Location Path = "recoverpassword. aspx">

<System. Web>

<Authorization>

<Allow users = "? "/>

</Authorization>

</System. Web>

</Location>

 

<System. Web>

<Authentication mode = "forms">

<Forms loginurl = "userlogin. aspx"/>

</Authentication>

<Authorization>

<Deny users = "? "/>

</Authorization>

</System. Web>

</Configuration>

 

2, SetPasswordrecoveryControls are placed on the page, as shown in the following example:

<Asp: passwordrecovery id = "passwordrecovery1" runat = "server">

</ASP: passwordrecovery>

 

3 Or, configure the following template to customize Passwordrecovery Widget appearance: Usernametemplate , Questiontemplate And Successtemplate .

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.