473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Unable to retrieve profile info

I'm just starting my first 2.0 site with the new membership features and am
having some trouble with profiles. I have my providers set up and working
fine and profile data is being written to the database. However, I can't
retrieve any of the stored profile values on my site. I set up the provider
and everything just like it is explained in the various MSDN articles, but
still nothing.

Any thoughts?
Apr 6 '06 #1
13 2055
Hi Ashley,

How are you writing profile data to the database, is it through the
Page.Profile object? When you try to retrieve you profile data, do the
profile fields you configured in web.config appear under Intellisense?

Chris

Apr 6 '06 #2
I'm writing the values through a click handler like this:

profile.DisplayName = txtDisplayName.Text

The data is making it to the database just fine, but doesn't come back when
I make a call to profile.DisplayName

DisplayName does show up under Intellisense when I type in "profile".

"Chris Fulstow" wrote:
Hi Ashley,

How are you writing profile data to the database, is it through the
Page.Profile object? When you try to retrieve you profile data, do the
profile fields you configured in web.config appear under Intellisense?

Chris

Apr 6 '06 #3
In which event handler are you trying to read the profile values?

Apr 6 '06 #4
Isn't it Profile.DisplayName (with a capital "P")

If your using VB then I don't think it makes much of a difference; but
this is the only thing I can think of.

Apr 6 '06 #5
I just made a simple form with a textbox and a button. When the button is
clicked it fires the click handler and apparently does the update because the
database is correct.

"Chris Fulstow" wrote:
In which event handler are you trying to read the profile values?

Apr 6 '06 #6
I'm using VB, so it shouldn't matter.

"tdavisjr" wrote:
Isn't it Profile.DisplayName (with a capital "P")

If your using VB then I don't think it makes much of a difference; but
this is the only thing I can think of.

Apr 6 '06 #7
Do you get IntelliSense for your profile properties when you set the
value, or do you need to type it manually? Can you see the profile
data in the database, or is it just the profile table structure?

Apr 6 '06 #8
Yes, I get the Intellisense for the profile entry I created. The profile
data does get written to the database. Everything is happening the way it's
supposed to except for when I actually try and display the profile data
somewhere.

So, on the form I created to change the Display name I have this in my
Page_Load:

If Not Page.IsPostBack then
txtDisplayName.Text = profile.DisplayName
End If

And the click handler has only this:

profile.DisplayName = txtDisplayName.Text

The txtDisplayName textbox never has the existing profile in it on page
load, nor do any of the other pages where I attempt to call
profile.DisplayName.

"Chris Fulstow" wrote:
Do you get IntelliSense for your profile properties when you set the
value, or do you need to type it manually? Can you see the profile
data in the database, or is it just the profile table structure?

Apr 6 '06 #9
All looks ok, what have you got in the <profile> section of your
web.config? Are you using some sort of authentication or is it
anonymous users?

Apr 6 '06 #10
Anonymous users can't even reach the form for setting a DisplayName.

I'm at work right now and don't have access to my Web.config file directly,
so I'll do my best to reproduce the profile section from memory:

<profile enabled="true" providerName="sqlProfileProvider">
<providers>
<clear/>
<add name="sqlProfileProvider" connectionString="TNSDB" />
</providers>
<properties>
<add name="DisplayName" type="System.String" />
</properties>
</profile>

"Chris Fulstow" wrote:
All looks ok, what have you got in the <profile> section of your
web.config? Are you using some sort of authentication or is it
anonymous users?

Apr 6 '06 #11
It seems a bit weird that IntelliSense shows your profile properties in
the button click handler, but not in the page load handler? Both
methods should be referencing the same Page object with the same
properties.

Can you read the profile property in the button click handler, as well
as write it?

Apr 7 '06 #12
Oh, it gets weirder...

I put in a msgbox to tell me what the value of profile.DisplayName is right
before I do profile.DisplayName = txtDisplayName.Text and it shows me the
right value.

I also set up a label on the page that gets it's value from the
profile.DisplayName as well during the page_load. Same deal here as with the
textbox though, in that the value isn't there until after the submit button
is clicked.

"Chris Fulstow" wrote:
It seems a bit weird that IntelliSense shows your profile properties in
the button click handler, but not in the page load handler? Both
methods should be referencing the same Page object with the same
properties.

Can you read the profile property in the button click handler, as well
as write it?

Apr 7 '06 #13
Hi Ashley,

Might be worth looking through this MS training video:
http://download.microsoft.com/downlo...emes_final.wmv

It does pretty much the same thing as you're trying, so might be
helpful.

HTH,
Chris

Apr 11 '06 #14

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: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
1
by: VB Programmer | last post by:
I am using personalization/profile to store info for the user that is not contained in the aspnet_Users or aspnet_Membership tables. This info includes, firstname, lastname, and phonenumber. ...
0
by: a | last post by:
Q. Unable to get a Profile custom (object) collection to bind to GridView,etc (IList objects)? This is my first custom object so I may be doing something rather simple, wrong, or it may be...
2
by: Peter Afonin | last post by:
Hello, I'm using CreateUserWizard control in ASP.NET 2.0. I'm storing the data in SQL Server 2005. The first and last steps run smoothly without any problems. But I added one middle step to...
5
by: Johnny BeGood | last post by:
Hi All, Has anyone got any ideas on how to retrieve mobile phone info from a phone that connects to my web site, I want to use that data as part of logon authentication, for example: <?php...
4
by: ian | last post by:
A few weeks ago I was able to run remote debugging from my local machine (VS 2005 XP sp2) but now I get the following message: unable to start debugging on the web server. logon failure: unknown...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.