+1-888-365-2779
Try Now
More in this section
Categories
Bloggers
Blogs RSS feed

Change Password and Password Recovery Controls in Sitefinity

by Georgi Chokov
Although the Change Password and the Password Recovery controls, from Visual Studio, were not included with Sitefinity, you can create them yourself. First, make a user control and place a Password Recovery and a Change Password control on it. In this case, I will call them PasswordRecovery1 and ChangePassword1. Then, go into the code-behind and make public properties for each control. Here is a code sample:

 

public partial class UserControls_PasswordRecovery : System.Web.UI.UserControl 
    //Make the public property of type Password Recovery, so you can  
    //read, edit, update and delete its properties without entering Visual Studio 
    public PasswordRecovery PasswordRecovery 
    { 
        get 
        { 
            //Get the instance of the password recovery control in the .ascx file 
            return this.PasswordRecovery1; 
        } 
        set 
        { 
            //Update properties, based on values from the password recovery control in the .ascx file 
            this.PasswordRecovery1 = value; 
        } 
    } 
 
    //Make the public property of type Change Password, so you can  
    //read, edit, update and delete its properties without entering Visual Studio 
    public ChangePassword ChangePassword 
    { 
        get 
        { 
            //Get the instance of the change password control in the .ascx file 
            return this.ChangePassword1; 
        } 
        set 
        { 
            //Update properties, based on values from the change password control in the .ascx file 
            this.ChangePassword1 = value; 
        } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
 
  Once you make the user control, you can upload it to Sitefinity.

1 comment

Leave a comment
  1. inna May 01, 2012
    how do i make my site to be pwd protected? using 3.7sp4

    Leave a comment