本文介绍了Telerik Membership中的ResetPassword方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我重置密码时,我会收到以下错误:''密码重置未启用。将成员资格提供者的EnablePasswordReset属性设置为true''有人可以帮助我吗?



When I resetpassword, I take following error : ''Password reset is not enabled. Set the EnablePasswordReset property of the membership provider to true'' Can somebody help me?

My code:

 public static string GetCurrentUserPassword(string userName)
    {
        MembershipProvider p = (MembershipProvider)Membership.Providers["Default"];     
        MembershipUser obj = Membership.GetUser(userName);
        return obj.ResetPassword();               
    }  

web config :

  <siteMap defaultProvider="SitefinitySiteMap">
            <providers>
                <add name="SitefinitySiteMap" type="Telerik.Sitefinity.Web.SitefinitySiteMap, Telerik.Sitefinity" enablePasswordReset="true" requiresQuestionAndAnswer="false"  taxonomyProvider="OpenAccessDataProvider" pageTaxonomy="Pages" rootNode="FrontendSiteMap" pageProvider="OpenAccessDataProvider"/>
            </providers>
        </siteMap>
        <roleManager enabled="false"/>
        <membership defaultProvider="Default">
            <providers>
                <clear/>
                <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"  enablePasswordReset="true" requiresQuestionAndAnswer="false"/>
            </providers>
        </membership>

推荐答案


这篇关于Telerik Membership中的ResetPassword方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 01:50