ASP.NET Profile Provider Not Working

Discussion in 'ASP .Net' started by =?Utf-8?B?RGlya0dvZXM=?=, Nov 13, 2007.

  1. I have added some profile properties to my web.config:
    <profile enabled="true">
    <properties><add name="firstname"/></properties>
    </profile>
    However when I try to access the property in a code behind it does not
    exist. The following code does not work (says firstname is not a property):

    Profile.firstname

    I have rebuilt the solution. I am using VB.NET
     
    =?Utf-8?B?RGlya0dvZXM=?=, Nov 13, 2007
    #1
    1. Advertising

  2. re:
    !> when I try to access the property in a code behind it does not exist.

    You need to add the data type, too.

    <profile enabled="true">
    <properties>
    <add name="firstname" type="string"/>
    <add name="Country" type="string"/>
    <add name="Gender" type="string"/>
    <add name="Age" type="Int32"/>
    </properties>
    </profile>

    Please review Scott Guthrie's Profile blog entry at :

    http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx

    Also, Scott Mitchell's 9-part membership tutorial helps a lot,
    particularly part 6, for implementing custom profile properties :

    http://aspnet.4guysfromrolla.com/articles/101106-1.aspx

    Scott details other properties you can add which you might want to explore.

    There's a code sample for the part 6 article at :
    http://aspnet.4guysfromrolla.com/code/Membership.6.zip



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "DirkGoes" <> wrote in message
    news:...
    >I have added some profile properties to my web.config:
    > <profile enabled="true">
    > <properties><add name="firstname"/></properties>
    > </profile>
    > However when I try to access the property in a code behind it does not
    > exist. The following code does not work (says firstname is not a property):
    >
    > Profile.firstname
    >
    > I have rebuilt the solution. I am using VB.NET
    >
    >
     
    Juan T. Llibre, Nov 13, 2007
    #2
    1. Advertising

  3. Thanks Juan, I did read some of these posts, but my profile will still not
    activate. Apprently when you add the properties to web.config the role
    provider class gets recompiled. But this does not seem to happen for me.

    In the meantime I have written my own profile table. I spent half a day on
    it and had to move on.

    "Juan T. Llibre" wrote:

    > re:
    > !> when I try to access the property in a code behind it does not exist.
    >
    > You need to add the data type, too.
    >
    > <profile enabled="true">
    > <properties>
    > <add name="firstname" type="string"/>
    > <add name="Country" type="string"/>
    > <add name="Gender" type="string"/>
    > <add name="Age" type="Int32"/>
    > </properties>
    > </profile>
    >
    > Please review Scott Guthrie's Profile blog entry at :
    >
    > http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx
    >
    > Also, Scott Mitchell's 9-part membership tutorial helps a lot,
    > particularly part 6, for implementing custom profile properties :
    >
    > http://aspnet.4guysfromrolla.com/articles/101106-1.aspx
    >
    > Scott details other properties you can add which you might want to explore.
    >
    > There's a code sample for the part 6 article at :
    > http://aspnet.4guysfromrolla.com/code/Membership.6.zip
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > "DirkGoes" <> wrote in message
    > news:...
    > >I have added some profile properties to my web.config:
    > > <profile enabled="true">
    > > <properties><add name="firstname"/></properties>
    > > </profile>
    > > However when I try to access the property in a code behind it does not
    > > exist. The following code does not work (says firstname is not a property):
    > >
    > > Profile.firstname
    > >
    > > I have rebuilt the solution. I am using VB.NET
    > >
    > >

    >
    >
    >
    >
     
    =?Utf-8?B?RGlya0dvZXM=?=, Nov 14, 2007
    #3
    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. =?Utf-8?B?Z2V0ZG90bmV0?=

    Custom profile provider asp.net 2.0

    =?Utf-8?B?Z2V0ZG90bmV0?=, Jul 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    567
    =?Utf-8?B?Z2V0ZG90bmV0?=
    Jul 6, 2005
  2. =?Utf-8?B?dmE=?=

    ASP.NET Profile Provider benefits and pitfalls?

    =?Utf-8?B?dmE=?=, Mar 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    563
    =?Utf-8?B?dmE=?=
    Mar 24, 2006
  3. Danial
    Replies:
    0
    Views:
    494
    Danial
    Jun 10, 2006
  4. Darius

    ASP.NET 2.0 Custom Profile Provider

    Darius, Nov 3, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,532
    Darius
    Nov 3, 2006
  5. Andy B
    Replies:
    0
    Views:
    528
    Andy B
    May 3, 2008
Loading...

Share This Page