Recent Posts

Tags

Community

Email Notifications

All Links

Blogs I Read

My Articles

JavaScript & CSS

Date & Time

SQL Server 2000/2005

Articles I Read

ASP.NET Free Controls

MVFP (Most Valuable Forum Posts)

Archives

Profile & Anonymous State

I was exploring today Profile and how to work with them.

I notice something which I would like to share it with you.

Suppose we have the following configuration section:

<authentication mode="Forms"/>
        <anonymousIdentification enabled="true"/>

        <profile enabled="true">
            <properties>
                <add name="ZipCode" type="int" />
                <add name="EmailAddresses" type="System.Collections.Specialized.StringCollection" serializeAs="Xml" />
                <group name="Address">
                    <add name="Street" type="System.String" />
                    <add name="City" type="System.String" />
                    <add name="State" type="System.String" />
                    <add name="CountryOrRegion" type="System.String" />
                group>
            properties>
        profile>

FormsAuthentication is used, Anonymous Identification is enabled. Keep in mind that the first time the page executes you are considered an anonymous user.

Inside the code, you can set the value for Profile.EmailAddress.Add(”...”), despite the fact that:

1- You did not add allowAnonymous to the field EmailAddresses.

2- Whatever the value of AnonymousIdentification's value (enabled/disabled) is.

However, you cannot set the value for any of the group profile members without having to explicitly add the allowAnonymous field to any of the properties of the group, despite the fact you have enabled AnonymousIdentification.

 

Strange ha?

 

Regards

Leave a Comment

(required) 

(required) 

(optional)

(required)