In asp.net (using MVC, but this happens in regular too)
Profile.GetProfile(username);
will update the LastActivityDate for that user. This
You might use one ugly workaround which includes changing aspnet_Profile_GetProperties
stored procedure. This one is responsible for getting the properties while accessing user profile.
Open this procedure and you will find following code at the bottom:
IF (@@ROWCOUNT > 0)
BEGIN
UPDATE dbo.aspnet_Users
SET LastActivityDate=@CurrentTimeUtc
WHERE UserId = @UserId
END
Remove it in order to stop updating the LastActivityDate
. You will still get LastActivityDate
updated when calling Membership.GetUser(username, true);
.