Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > How to programatically activate the ASP.net "Password Recovery" ?

Reply
Thread Tools

How to programatically activate the ASP.net "Password Recovery" ?

 
 
Ofer
Guest
Posts: n/a
 
      10-09-2006
Hi,

We use the ASP.net loginControls and the DB schema.
How to programmatically activate the "PasswordRecovery" of a specific
end-user when a user clicks my web application's button?
I need to send a specific user an email with a new "reset" password.

I thought of including an invisible PasswordRecovery Control and initialize
the "User Name" field.
PasswordRecovery1.UserName = "zako";
PasswordRecovery1.Visible = false;
But how to simulate a "click" of the PasswordRecovery control's "Submit"
button?

Thanks!
 
Reply With Quote
 
 
 
 
offwhite
Guest
Posts: n/a
 
      10-09-2006
I created some free ASP.NET controls you may find useful.

http://brennan.offwhite.net/blog/200...es-management/

They are simply User Controls which use the Membership Provider. These
controls do not have a button to reset the password for a user, but you
can do that with this code.

Private Sub ResetPassword(ByVal username As String)
Dim user As MembershipUser = Membership.GetUser(username)
Dim oldPassword As String = user.GetPassword()
Dim newPassword As String = Membership.GeneratePassword(8, 2)
user.ChangePassword(oldPassword, newPassword)
' send new password to user.Email
End Sub

It generates a new password for the user. Once done, you can send that
user an email with the new password.

Brennan Stehling
http://brennan.offwhite.net/blog/

Ofer wrote:
> Hi,
>
> We use the ASP.net loginControls and the DB schema.
> How to programmatically activate the "PasswordRecovery" of a specific
> end-user when a user clicks my web application's button?
> I need to send a specific user an email with a new "reset" password.
>
> I thought of including an invisible PasswordRecovery Control and initialize
> the "User Name" field.
> PasswordRecovery1.UserName = "zako";
> PasswordRecovery1.Visible = false;
> But how to simulate a "click" of the PasswordRecovery control's "Submit"
> button?
>
> Thanks!


 
Reply With Quote
 
 
 
 
Ofer
Guest
Posts: n/a
 
      10-22-2006
Hi,

Thanks a lot for your reply.

However it will only help after I solve this one -
How can my server app reset a password programaticaly in a different
membership provider than the one my server app is using?

Thanks!

"offwhite" wrote:

> I created some free ASP.NET controls you may find useful.
>
> http://brennan.offwhite.net/blog/200...es-management/
>
> They are simply User Controls which use the Membership Provider. These
> controls do not have a button to reset the password for a user, but you
> can do that with this code.
>
> Private Sub ResetPassword(ByVal username As String)
> Dim user As MembershipUser = Membership.GetUser(username)
> Dim oldPassword As String = user.GetPassword()
> Dim newPassword As String = Membership.GeneratePassword(8, 2)
> user.ChangePassword(oldPassword, newPassword)
> ' send new password to user.Email
> End Sub
>
> It generates a new password for the user. Once done, you can send that
> user an email with the new password.
>
> Brennan Stehling
> http://brennan.offwhite.net/blog/
>
> Ofer wrote:
> > Hi,
> >
> > We use the ASP.net loginControls and the DB schema.
> > How to programmatically activate the "PasswordRecovery" of a specific
> > end-user when a user clicks my web application's button?
> > I need to send a specific user an email with a new "reset" password.
> >
> > I thought of including an invisible PasswordRecovery Control and initialize
> > the "User Name" field.
> > PasswordRecovery1.UserName = "zako";
> > PasswordRecovery1.Visible = false;
> > But how to simulate a "click" of the PasswordRecovery control's "Submit"
> > button?
> >
> > Thanks!

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
what does this error mean `activate': can't activate activesupport (=3.0.1, runtime) for ["activerecord-3.0.1"] Junkone Ruby 2 10-27-2010 09:13 AM
How to activate Firefox? W. Wells Firefox 4 10-30-2005 06:55 AM
no wireless networks shown/need to activate encryption =?Utf-8?B?ZC5mb3JtLmQ=?= Wireless Networking 3 02-10-2005 03:27 PM
How to Activate Links In Emails in Thunderbird? Ann Speakman Firefox 8 12-18-2004 06:51 PM



Advertisments