New Posts New Posts RSS Feed: reset a users password when using ASP.net membership
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Forum Lockedreset a users password when using ASP.net membership

 Post Reply Post Reply
Author
DataMan View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Jul-2007
Location: Canada
Posts: 52
Post Options Post Options   Quote DataMan Quote  Post ReplyReply Direct Link To This Post Topic: reset a users password when using ASP.net membership
    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
 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1390
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
DataMan View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Jul-2007
Location: Canada
Posts: 52
Post Options Post Options   Quote DataMan Quote  Post ReplyReply Direct Link To This Post 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.
 
 
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down