To add new properties to the Profile property accessed through the Page
class, you can modify the web.config. example below
<system.web>
<profile automaticSaveEnabled="true" >
<properties>
<add name="Name" type="System.String"/>
<add name="DateOfBirth" type="System.DateTime"/>
</properties>
</profile>
</system.web>
The ASP.NET compiler will add the above two added properties to the ProfileCommon class which is being access by the Profile Property of the page class.
protected void Page_Load(object sender, EventArgs e)
{
if(Profile.Name == null)
{
Response.Write(Profile.Name);
}
}
HTH,
Best Regards,
After spending almost 1 year contributing in the ASP.NET forums, i collected some tips to help community members to achieve fast, accurate, and direct answers from the experts. Below are the steps
- Choose the appropriate forum where your post belongs
- Supply a descriptive title for your post
- Start your post by mentioning which .NET framework, language, IDE, and which web browser you are using
- Demonstrate what you are trying to achieve
- Demonstrate where your problem relies
- Supply the code that needs to be fixed.
- Go directly straight to the point.
- Write a well formatted post.
The above tips give experts the ultimate option to answer your post directly without having you to wait more time trying to explain your issue.
N.B: Experts you are welcomed to add on the list if you have anything else to be considered.
Hope this helps,
Best Regards