ChangePasswordForm design mode exception - Bugs & Issues - Bugs & Issues - Progress Community
 Bugs & Issues

ChangePasswordForm design mode exception

  • ChangePasswordForm design mode exception
  • Hi,
    After creating a new project, adding a page with a Telerik.Sitefinity.Security.Web.UI.ChangePasswordForm control I get a System.IndexOutOfRangeException when trying to edit the page again. When I first added the control, it had the DisplayUserName property in False, but it shows the field anyway.
    I need to provide my Front end users the ability to change their passwords. Any suggestions?
    Thanks in advance
  • Hello Pablo,

    Thanks a lot for reporting this issue. To workaround the exception, you could create your own control overriding Telerik.Sitefinity.Security.Web.UI.ChangePasswordForm like this:

    using Telerik.Sitefinity.Security.Web.UI;
    using System.Web.UI;
     
    namespace SitefinityWebApp
        public class CustomChangePasswordForm : ChangePasswordForm
        
            protected override void CreateChildControls()
            
                base.CreateChildControls();
                var changePasswordContainer = this.FindControl("ChangePasswordContainerID") as ChangePasswordContainer;
                if (changePasswordContainer != null)
                
                    changePasswordContainer.UserNameTextBox.Visible = this.DisplayUserName;
                    var userNameLabel = changePasswordContainer.FindControl("UserNameLabel");
                    if(userNameLabel != null)
                        userNameLabel.Visible = this.DisplayUserName;
                
            
     
            protected override object SaveViewState()
            
                object[] objArray = new object[] null, (this.MailDefinition != null) ? ((IStateManager)this.MailDefinition).SaveViewState() : null ;
                for (int i = 0; i < objArray.Length - 1; i++)
                
                    if (objArray[i] != null)
                    
                        return objArray;
                    
                
                return null;
            
        

    The problem will be fixed in the next release.

    Kind regards,
    Pepi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items