Hi there,
I have a webform that adds new members and their role to a website. I have some custom fields, which I have created in the Profile section of my web.config file as follows:
<system.web>
<profile>
<providers>
</providers>
<properties>
<add name="LocalAuthority" type="String" serializeAs="String" />
<add name="Developer" type="String" serializeAs="String" />
<add name="SalesAgent" type="String" serializeAs="String" />
</properties>
</profile>
</system.web> However, when I am having trouble accessing and adding the Profile values in the code behind. Intellisense does not allow me to chose Profile, which in turn means that I cannot access the custom values. This is the code I am using:
Membership.CreateUser(txtUsername.Text, txtPassword.Text, txtEmail.Text);
// Add user to all selected roles from the roles listbox
for (int i = 0; i < lbRoles.Items.Count; i++) {
if (lbRoles.Items[i].Selected == true)
Roles.AddUserToRole(txtUsername.Text, lbRoles.Items[i].Value);
}
// Add custom field data to Profile
// This is where I am stuck - I can't get the Profile.Developer etc. to appear Any ideas where I am going wrong?