Home All Groups Group Topic Archive Search About

Error: 'CreateUser' is not a member of 'Membership'

Author
12 Jan 2006 10:45 PM
VB Programmer
I am getting this error:  error BC30456: 'CreateUser' is not a member of
'Membership'.

What does that mean?  Here's my code.  It seems correct (no squigglies,
etc...)
            ' store it in db
            Dim result As System.Web.Security.MembershipCreateStatus
            Try
                Dim newUser As MembershipUser =
Membership.CreateUser(Me.txtUsername.Text, Me.txtPassword.Text,
Me.txtEmail.Text, Me.ddlSecurityQuestion.SelectedItem.Text,
Me.txtSecurityAnswer.Text, False, result)
                If newUser Is Nothing Then
                    Me.lblUserReject.Text = GetErrorMessage(result)
                Else
                    Response.Redirect("ThankYouSubmitApp.aspx")
                End If
            Catch
                Me.lblUserReject.Text = "An exception occurred creating the
user."
            End Try

Thanks,
Robert

Are all your drivers up to date? click for free checkup

Author
13 Jan 2006 3:14 AM
VB Programmer
Thanks.

I followed that example exactly.  I still get a build error, 'CreateUser' is
not a member of 'Membership'...

------ Build started: Project: 1320Stompers_deploy, Configuration: Debug Any
CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v
/1320Stompers -p C:\work-related\Websites\1320Stompers -u -f -d
C:\work-related\Websites\1320Stompers_deploy\1320Stompers_deploy\Debug\
C:\work-related\Websites\1320Stompers\SubmitProfile.aspx.vb(45): error
BC30456: 'CreateUser' is not a member of 'Membership'.
Done building project "1320Stompers_deploy.wdproj" -- FAILED.
========== Build: 0 succeeded or up-to-date, 2 failed, 0 skipped ==========

Here's my code:
           Dim status As MembershipCreateStatus
            Try
                Dim newUser As MembershipUser =
Membership.CreateUser(Me.txtUsername.Text, Me.txtPassword.Text, _
                                                   Me.txtEmail.Text,
Me.txtSecurityAnswer.Text, _
                                                   Me.txtSecurityAnswer.Text,
False, status)
                If newUser Is Nothing Then
                    Me.lblUserReject.Text = GetErrorMessage(status)
                Else
                    Response.Redirect("ThankYouSubmitApp.aspx")
                End If
            Catch
                Me.lblUserReject.Text = "An exception occurred creating the
user."
            End Try

I didn't like this line, I guess:

                Dim newUser As MembershipUser =
Membership.CreateUser(Me.txtUsername.Text, Me.txtPassword.Text, _

I restarted VS2005 with the same result.

Any ideas?

Show quoteHide quote
"Henrique Mello" <hme***@gmail.com> wrote in message
news:1137108857.770330.100740@g44g2000cwa.googlegroups.com...
> Well, hope this helps
>
> http://msdn2.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx
>
Author
13 Jan 2006 5:50 AM
VB Programmer
Fully qualifying it seemed to fix it...
                Dim newUser As MembershipUser =
System.Web.Security.Membership.CreateUser(Me.txtUsername.Text,

BUT, at the top I had put
                Imports System.Web.Security
So that doesn't make sense....


Show quoteHide quote
"VB Programmer" <d***@emailme.com> wrote in message
news:OcE7r9%23FGHA.3056@TK2MSFTNGP09.phx.gbl...
> Thanks.
>
> I followed that example exactly.  I still get a build error, 'CreateUser'
> is not a member of 'Membership'...
>
> ------ Build started: Project: 1320Stompers_deploy, Configuration: Debug
> Any CPU ------
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v
> /1320Stompers -p C:\work-related\Websites\1320Stompers -u -f -d
> C:\work-related\Websites\1320Stompers_deploy\1320Stompers_deploy\Debug\
> C:\work-related\Websites\1320Stompers\SubmitProfile.aspx.vb(45): error
> BC30456: 'CreateUser' is not a member of 'Membership'.
> Done building project "1320Stompers_deploy.wdproj" -- FAILED.
> ========== Build: 0 succeeded or up-to-date, 2 failed, 0 skipped
> ==========
>
> Here's my code:
>           Dim status As MembershipCreateStatus
>            Try
>                Dim newUser As MembershipUser =
> Membership.CreateUser(Me.txtUsername.Text, Me.txtPassword.Text, _
>                                                   Me.txtEmail.Text,
> Me.txtSecurityAnswer.Text, _
>
> Me.txtSecurityAnswer.Text, False, status)
>                If newUser Is Nothing Then
>                    Me.lblUserReject.Text = GetErrorMessage(status)
>                Else
>                    Response.Redirect("ThankYouSubmitApp.aspx")
>                End If
>            Catch
>                Me.lblUserReject.Text = "An exception occurred creating the
> user."
>            End Try
>
> I didn't like this line, I guess:
>
>                Dim newUser As MembershipUser =
> Membership.CreateUser(Me.txtUsername.Text, Me.txtPassword.Text, _
>
> I restarted VS2005 with the same result.
>
> Any ideas?
>
> "Henrique Mello" <hme***@gmail.com> wrote in message
> news:1137108857.770330.100740@g44g2000cwa.googlegroups.com...
>> Well, hope this helps
>>
>> http://msdn2.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx
>>
>
>

Bookmark and Share