Explanation:
I also had the same issue with my members Profile. It was beeing
updated every time some one visit members profile. I used a System.DateTime
type Pofile field. This field is used to save the member birth date.
If your ASP.NET 2.0 user profile’s LastActivityDate gets
updated every time you use Profile.GetProfile() it’s most
likely the result of having complex types defined in the profile. Here’s an
excerpt from
QuickStart Tutorial page:
The Profile feature will automatically determine whether or not
a Profile is dirty. If the Profile
appears to be dirty, the ProfileModule that runs at
the end of each page request will call the Save method on the
Profile, thus saving data using the configured provider(s). However,
the Profile feature can only reliably detect changes to data when
the data is typed as either a System.String, or as
a primitive type like System.Int16, System.Int32,
etc… If a Profile contains more complex data-types,
the default behavior of the Profile feature assumes the Profile
is dirty, and will always attempt to save the data. To optimize performance, a developer
can implement logic in their pages to determine if the Profile really is
dirty. If a developer determines the Profile has not changed, they can
hook the ProfileAutoSaving event by writing an event
handler in global.asax. The event argument includes
a property called ContinueWithProfileAutoSave. If
a developer sets this property to false,
then ProfileModule will not attempt to save the
Profile.
Note that if a developer never wants the ProfileModule to attempt saves, the automatic
save behavior for the feature can be turned off by setting the automaticSaveEnabled
attribute on the
element to false.
|