473,473 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET Profile Provider Not Working

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
Nov 13 '07 #1
2 4131
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/archi...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" <Di******@discussions.microsoft.comwrote in message
news:5D**********************************@microsof t.com...
>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



Nov 13 '07 #2
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/archi...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" <Di******@discussions.microsoft.comwrote in message
news:5D**********************************@microsof t.com...
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

Nov 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: | last post by:
Hi all, How can I get a reference to my custom profile provider in my .aspx page? I have looked at httpcontext.current.profile. But from there where do I go? Ideally I would like to be able to...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
0
by: Phil | last post by:
I created a custom profile provider based on the example here : http://www.theserverside.net/articles/showarticle.tss?id=CreatingProfileProvider It works ok, but when I try to get the last update...
1
by: vishnu | last post by:
I am working on Profile system.I am using CreateUserWizard control for creating New User.I want to add more information other than (UserName,Email,Password,ConfirmPassword.....) such as...
9
by: Eric Falsken | last post by:
I've added a number of additional properties to my profile. Sometimes, the values are populated when the user is retrieved from the database, but sometimes the values are empty/default. How can I...
10
karlr
by: karlr | last post by:
OK, I know this has been discussed in multiple posts. However, I still have not seen a good example. That is, I have a custom Membership provider using the ASP.NET 2.0 controls. I am restricted...
11
by: Weston Weems | last post by:
I've got the need to have user information for logged in user in a readily avaliable page context (a lot like how Profile is) except not suck. Before we jump to any conclusions, from what I...
9
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
2
by: Annie | last post by:
Hello guys, I have set the MEMBERSHIP, ROLEMANAGER and PROFILE in my config file as below. I just want to use my own sql server 2000 table instead of MSDB.
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.