Not Getting Profile properties in Code Behind.
- by user228777
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.