I am not getting the 'Profile' property in the code behind
hai ,
I have added some profile properties to my web.config:
<profile automaticSaveEnabled ="true">
<properties>
<add name="NumVisits" type="System.Int32"/>
<add name="UserName" type="System.String"/>
<add name="Gender" type="bool"/>
<add name="Birthday" type="System.DateTime"/>
</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.Gender And In the Asp.net Configuration 'Profile tab ' Is not showing. I have rebuilt the solution. I am using VB.NET(3.5)
Another way to retrieve Profile properties value is like below.
object obj = HttpContext.Current.Profile["PropertyName"]; (C# code).
精彩评论