Print Page | Close Window

reset a users password when using ASP.net membership

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2123
Printed Date: 26-Apr-2024 at 6:19am


Topic: reset a users password when using ASP.net membership
Posted By: DataMan
Subject: reset a users password when using ASP.net membership
Date Posted: 03-Sep-2010 at 10:50am
Hi there...
 
I am trying to take your example of the ASP.net membership for silverlight and add on a stack panel that allows the user to reset their password.  When they enter their username I want it to run the

string mNewPassword = Membership.Provider.ResetPassword(UserName, "Dummy");

and then use the smtp.Send to send their password to them.
 
Problem is that the Membership exists in the web code and when i try to add it to the silverlight app, of course it doesn't like it because System.Web.Security isn't a reference in the silverlight application.
 
I was thinking of using the POCO and update the user somewhow which will then run the UserRegistrationProvider you have and then in the UpdateUser I will execute the ResetPassword code.
 
I'm wondering if there is a better way of doing this?
 
Thanks
 



Replies:
Posted By: kimj
Date Posted: 03-Sep-2010 at 11:19am
Using POCO as you've described is a good way to update user information; you could stick a dummy password or tag into the UserInformation to indicate the processing needed on the server in the UpdateUser logic.  As you probably know we keep promising to have product changes and guidance for ASP.NET user registration, but this is still forthcoming as of version 6.0.5.0, so the POCO approach as shown in the sample application is still valid.


Posted By: DataMan
Date Posted: 06-Sep-2010 at 3:30pm
So,  the way I did it is in now way the correct way but hey,  gets the job done.
 
For others who are starting out I simply copied the code from the completed registration code section into a new section which then creates a new entity and then saves .  Like above the passowrd tells the createuser logic to reset the password instead of creating a new user.
 
I am so new to WPF and Silverlight that I couldn't figure out how to easily load and update the user in the UpdateUser logic so I didn't bother.

I couldn't find an easy sample on how to load and update a record in a silverlight entity manager.  And the userinformation really isn't an entity so with the short time I had, I couldn't figure out how that would work.
 
 
 
 



Print Page | Close Window