1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Where is the SF public password recovery control?????????

Where is the SF public password recovery control?????????

6 posts, 0 answered
  1. sam
    sam avatar
    102 posts
    Registered:
    31 Jan 2008
    13 Feb 2012
    Link to this post
    Where can I get the SF passwordrecovery control? I am wanting to add it to a public site page.
    The old asp.net controls no longer work and I was able to change my custom login view control to reference public SF controls.

    My question is where is the SF PasswordRecovery control? I don't want to send our users off to the \sitefinity\login\passwordrecovery page. There is a widget template at C:\Program Files\Telerik\Sitefinity 4.4\SDK\Content\Resources\WidgetTemplates\Backend\Security\PasswordRecoveryUserNameTemplate.ascx, but it doesn't have a reference at the top to its namespace to function. Am I looking at the wrong thing?

    Custom user control with SF public login controls..
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginViewControl.ascx.cs" Inherits="UserControls_2010_LoginViewControl" %>
     
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls" TagPrefix="sf" %>
     
    <%@ Register src="LoginControl.ascx" tagname="LoginControl" tagprefix="uc1" %>
     
    <div runat="server">   
        <asp:LoginView ID="LoginView1" runat="server">
            <LoggedInTemplate>
            <div class="logged-in">
                <h2>Membership Login</h2>
                <p>
                    <span style="color:#9C9C87;"><asp:Literal ID="UserLabel" runat="server" Text="Logged in as: "></asp:Literal></span>
                    <strong><sf:LoginNameControl ID="loginName" runat="server" /></strong>
                    <nobr>( <sf:LoginStatusControl ID="loginStatus" runat="server" /> )</nobr><br />
                    <asp:HyperLink ID="hlReset" runat="server" NavigateUrl="~/Users/ChangePassword.aspx">Change your password</asp:HyperLink><br /> 
                </p>
            </div>
            <div id="update-details">
                <div class="inner">
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Membersanddelegates/UpdateYourDetails.aspx">Update your Details here</asp:HyperLink>
                </div>
            </div>
            </LoggedInTemplate>
            <AnonymousTemplate>
                <div id="login">
                    <h2>Membership Login</h2>
                    <sf:LoginControl ID="login1" runat="server" RememberMeText="Remember me next time" PasswordRecoveryText="Forgot your details?" ShowForgotPasswordLink="true" VisibleWhenLoggedIn="false" ShowChangePasswordLink="false" ShowHelpLink="false" HelpPageText="" RenderOuterTable="false" LoginButtonStyle-CssClass="login-btn" LoginButtonText="Login" LoginButtonType="Link" PasswordRecoveryUrl="~/Users/ResetPassword.aspx" />
                </div>    
            </AnonymousTemplate>
        </asp:LoginView>
    </div>

  2. sam
    sam avatar
    102 posts
    Registered:
    31 Jan 2008
    13 Feb 2012
    Link to this post
    It would be good if you could still use the ASP.NET PasswordRecovery control, but that is all out the window, which is a shame.. I might need to log a support call cause this is needed asap..
  3. SteveV
    SteveV avatar
    178 posts
    Registered:
    06 Nov 2011
    14 Feb 2012
    Link to this post
    I've always found the lack of these very basic controls in SF to be very odd. I ended up creating a simple user control for password recovery. Here's the code:

    View (embeded .ascx resource)
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="sf" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Security.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <asp:Panel ID="PasswordRecoverWrapper" runat="server" CssClass="nlgPasswordRecoveryWrp">
        <h2>
            Recover Your Password</h2>
        <asp:Panel ID="Panel1" runat="server" CssClass="nlgPasswordRecoveryContainer">
            <sf:PasswordRecoveryForm runat="server" AllowSelectMembershipProvider="true" ID="PWRecoveryForm" MailDefinition-From="webmaster@yourdomain.com" MailDefinition-IsBodyHtml="True" MailDefinition-Subject="Password Recovery">
                <MailDefinition From="webmaster@yourdomain.com" IsBodyHtml="True" Subject="yourdomain.com Password Recovery">
                </MailDefinition>
            </sf:PasswordRecoveryForm>
        </asp:Panel>
    </asp:Panel>


    Code behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Sitefinity.Web.UI;
    using Telerik.Sitefinity.Security;
    using Telerik.Sitefinity.Security.Model;
    using System.Web.UI.WebControls;
     
    namespace SitefinityWebApp.CustomControls
    {
        public class PasswordRecoveryWidget : SimpleView
        {
            #region Properties
     
            protected override string LayoutTemplateName
            {
                get
                {
                    return "SitefinityWebApp.CustomControls.Resources.Views.PasswordRecovery.ascx";
                }
            }
                    #endregion
     
            protected override void InitializeControls(GenericContainer container)
            {
                EnsureChildControls();
            }
        }
    }

    You'll need to do some styling but this should get you started.

    Hope this helps,

    Steve
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    14 Feb 2012
    Link to this post

    Hi,

    The out of the box Login widget that can be dropped onto a Sitefinity page provides the ForgotPassword functionality, however if you need to use it as a separate widget, I believe you might find the discussion we've had on this forum thread useful.
    For your convenience I'm attaching a sample user control and a short video demonstrating how it works. Please do not hesitate to get back to us if you need any further assistance on this functionality, we'll be glad to help

    Regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    12 Jun 2012
    Link to this post
    so.. what is the best way to change the URL for the Cancel link in the Password Recovery control so it goes back to the "public" login page and not the Sitefinity login page??

    Thanks you.
  6. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    15 Jun 2012
    Link to this post
    Hi,

    You can specify the CancelDestinationPageUrl in the control declaration.

    Regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered