Wednesday, August 18, 2010

How to Change Password ASP.Net without entering old password


The concept is to use one provider for password reset and one provider for every other function in your site.
And the code becomes like this:

Vb.Net Code:

        Dim user As MembershipUser
        user = Membership.GetUser(username)
        Dim oldpass As String = user.ResetPassword
        user.ChangePassword(oldpass, newpassword)

C# Code:

MembershipUser user = Membership.GetUser(username);
string oldpass = user.ResetPassword;
user.ChangePassword(oldpass, newpassword);

Hope you find it useful!


0 comments:

Post a Comment

Subscribe

Enter your email address:

Delivered by FeedBurner

Search Engine

Custom Search

Followers

Amazon Deals

Referral

The On Demand Global   Workforce - oDesk The On Demand Global   Workforce - Elance
Mylot.com
 

Monica Entertaining Finger Tips Copyright © 2009 Cosmetic Girl Designed by Ipietoon | In Collaboration with FIFA
Girl Illustration Copyrighted to Dapino Colada