Ben
2007-04-18 11:22:09 PM

Hi,

i try to get the password of the membershipuser that is just created in
ASPNETDB.MDF (i checked it) with CreateUserWizard.
I tried with "Clear" and with "Encrypted" (with generating a machinekey)
passwordFormat.
The property enablePasswordRetrieval="true".

The CreateUserWizard page redirects to the pw.aspx page which contains in
code-behind this code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
If User.Identity.IsAuthenticated Then
Dim pw As String
pw = Membership.GetUser.GetPassword.ToString
End If
End Sub


This produces following error for both "Clear" and "Encrypted"
passwordFormat at line:
' pw = Membership.GetUser.GetPassword.ToString'

"Value cannot be null.
Parameter name: passwordAnswer "

Thanks for help
Ben


 

Re: Value cannot be null;Parameter name: passwordAnswer

Alexey Smirnov
2007-04-19 03:15:00 AM

On Apr 18, 5:22 pm, "Ben" <b...@ds.fg>wrote:
>Hi,
>
>i try to get the password of the membershipuser that is just created in
>ASPNETDB.MDF (i checked it) with CreateUserWizard.
>I tried with "Clear" and with "Encrypted" (with generating a machinekey)
>passwordFormat.
>The property enablePasswordRetrieval="true".
>
>The CreateUserWizard page redirects to the pw.aspx page which contains in
>code-behind this code:
>
>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
>Handles Me.Load
>If User.Identity.IsAuthenticated Then
>Dim pw As String
>pw = Membership.GetUser.GetPassword.ToString
>End If
>End Sub
>
>This produces following error for both "Clear" and "Encrypted"
>passwordFormat at line:
>' pw = Membership.GetUser.GetPassword.ToString'
>
>"Value cannot be null.
>Parameter name: passwordAnswer "
>
>Thanks for help
>Ben

Ben, if I remember correctly, there is a passwordAnswer - an answer to
a security question.

 



Re: Value cannot be null;Parameter name: passwordAnswer

Ben
2007-04-19 03:38:00 AM

Hi Alexey; thanks for replying

I can see there are two syntaxes:
GetPassword()
and
GetPassword(passwordAnswer as string)

In the web.config, i change the property requiresQuestionAndAnswer="true"
to "false
and now it works.

But doing this way, there is no security question / answer in the
authentification form.
Is there no possibility to inplement a security question/answer?

thanks


"Alexey Smirnov" <alexey.smirnov@gmail.com>schreef in bericht
news:1176923706.108201.146070@y80g2000hsf.googlegroups.com...
>On Apr 18, 5:22 pm, "Ben" <b...@ds.fg>wrote:
>>Hi,
>>
>>i try to get the password of the membershipuser that is just created in
>>ASPNETDB.MDF (i checked it) with CreateUserWizard.
>>I tried with "Clear" and with "Encrypted" (with generating a machinekey)
>>passwordFormat.
>>The property enablePasswordRetrieval="true".
>>
>>The CreateUserWizard page redirects to the pw.aspx page which contains in
>>code-behind this code:
>>
>>Protected Sub Page_Load(ByVal sender As Object, ByVal e As
>>System.EventArgs)
>>Handles Me.Load
>>If User.Identity.IsAuthenticated Then
>>Dim pw As String
>>pw = Membership.GetUser.GetPassword.ToString
>>End If
>>End Sub
>>
>>This produces following error for both "Clear" and "Encrypted"
>>passwordFormat at line:
>>' pw = Membership.GetUser.GetPassword.ToString'
>>
>>"Value cannot be null.
>>Parameter name: passwordAnswer "
>>
>>Thanks for help
>>Ben
>
>Ben, if I remember correctly, there is a passwordAnswer - an answer to
>a security question.
>