Not Getting Profile properties in Code Behind.
Posted
by user228777
on Stack Overflow
See other posts from Stack Overflow
or by user228777
Published on 2010-03-26T12:20:54Z
Indexed on
2010/03/26
12:23 UTC
Read the original article
Hit count: 396
I am trying to get Profile properties in the code behind. But I am not getting any intellisence like Profile.Homephone or Profile.CellPhone. When I try
Dim memberprofile As ProfileBase = HttpContext.Current.Profile
Dim homePhone As String = memberprofile.GetPropertyValue("HomePhone").ToString()
I get Data is Null. This method or property cannot be called on Null values error. I have data for current user in the profile Table.
I get following results in immediate window
?HttpContext.Current.Profile.UserName.ToString
"sub2"
?Profile.DefaultProfile.Properties.Count
2
? HttpContext.Current.Profile("HomePhone")
"" {String}
String: ""
I am not able to run property values in page load event.
This is my web.config file setting.
© Stack Overflow or respective owner