how to use change the security question and answer

Discussion in 'ASP .Net Security' started by Roberto Kohler, Aug 22, 2006.

  1. I would like to allow users to change their security question and answer in
    much the same way they are allowed to change their password.

    I thought the ChangePassword control would allow them to also change their
    security question and answer but apparently it does not.

    Is there a way to do that?

    Any help would be greatly appreciated.

    Roberto
     
    Roberto Kohler, Aug 22, 2006
    #1
    1. Advertising

  2. FYI, this is how you do it:

    Public Sub ChangePasswordQuestion_OnClick(ByVal sender As Object, ByVal args
    As EventArgs)
    Try
    Dim u As MembershipUser = Membership.GetUser(User.Identity.Name)
    Dim result As Boolean
    result = u.ChangePasswordQuestionAndAnswer(PasswordTextbox.Text, _
    QuestionTextbox.Text, _
    AnswerTextbox.Text)

    If (result = True) Then
    Msg.Text = "Password Question and Answer changed."
    Else
    Msg.Text = "Password Question and Answer change failed."
    End If

    Catch e As Exception
    Msg.Text = "Change failed. Please re-enter your values and try again."
    End Try
    End Sub
     
    Roberto Kohler, Aug 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J.G.
    Replies:
    1
    Views:
    436
  2. Rolf Kemper
    Replies:
    0
    Views:
    408
    Rolf Kemper
    Dec 23, 2004
  3. Showjumper
    Replies:
    0
    Views:
    337
    Showjumper
    Jul 2, 2006
  4. Ken Fine
    Replies:
    2
    Views:
    1,762
    Allen Chen [MSFT]
    Aug 25, 2008
  5. AAaron123
    Replies:
    1
    Views:
    1,390
    Oriane
    Jan 16, 2009
Loading...

Share This Page