Default properties are working fine (such isApproved).
But when I try to create a profile I get always null
public class MemberProfile : ProfileBase
{
public static MemberProfile GetUserProfile(string username)
{
var z = Create(username); // <------ PROFILE COMMON is Correct
return Create(username) as MemberProfile; // Always returns null
}
public static MemberProfile GetUserProfile()
{
return Create(Membership.GetUser().UserName) as MemberProfile;
}
[SettingsAllowAnonymous(false)]
public string AuthGuid
{
get
{
var o = base.GetPropertyValue("auth_guid");
if (o == DBNull.Value)
{
return string.Empty;
}
return (string)o;
}
set
{
base.SetPropertyValue("auth_guid", value);
}
}
[SettingsAllowAnonymous(false)]
public string Name
{
get
{
var o = base.GetPropertyValue("name");
if (o == DBNull.Value)
{
return string.Empty;
}
return (string)o;
}
set
{
base.SetPropertyValue("name", value);
}
}
[SettingsAllowAnonymous(false)]
public string Surname
{
get
{
var o = base.GetPropertyValue("surname");
if (o == DBNull.Value)
{
return string.Empty;
}
return (string)o;
}
set
{
base.SetPropertyValue("surname", value);
}
}
[SettingsAllowAnonymous(false)]
public string Role
{
get
{
var o = base.GetPropertyValue("role");
if (o == DBNull.Value)
{
return string.Empty;
}
return (string)o;
}
set
{
base.SetPropertyValue("role", value);
}
}
[SettingsAllowAnonymous(false)]
public DateTime? LastLogin
{
get
{
var o = base.GetPropertyValue("last_login");
if (o == DBNull.Value)
{
return null;
}
return (DateTime)o;
}
set
{
base.SetPropertyValue("last_login", value);
}
}
[SettingsAllowAnonymous(false)]
public string Comments
{
get
{
var o = base.GetPropertyValue("comments");
if (o == DBNull.Value)
{
return string.Empty;
}
return (string)o;
}
set
{
base.SetPropertyValue("comments", value);
}
}
/*lockedUntil*/
[SettingsAllowAnonymous(false)]
public DateTime LockedUntil
{
get
{
var o = base.GetPropertyValue("lockedUntil");
if (o == DBNull.Value)
{
return new DateTime();
}
return (DateTime)o;
}
set
{
base.SetPropertyValue("lockedUntil", value);
}
}
}
Also, AuthGuid property is not set when ceating the user (with the provider key I suppose).
I don't have a deep understaning of the whole process, so I'm probably missing something...
I'm getting this error at runtime: "this profile property has already been defined"
It seems to be an issue with webapps (I'm using a web application project) which doesn't need the properties to be defined in web.config, but only in the class.
But if I remove the properties from web.config I don't get the error anymore but I don't retrieve the values to (they are always blank)
Still the Member integration
Ok, I'm still working on my member integration.
I think I'm missing somethig.
I have a profile with several custom fields, I've configure it but I can't retrieve it
Here's the web.config
Default properties are working fine (such isApproved).
But when I try to create a profile I get always null
Also, AuthGuid property is not set when ceating the user (with the provider key I suppose).
I don't have a deep understaning of the whole process, so I'm probably missing something...
thank you
Update: I was missing in the web.config to set
inherits="myclass, myAssembly"
But now I ran into another problem:
I'm getting this error at runtime: "this profile property has already been defined"
It seems to be an issue with webapps (I'm using a web application project) which doesn't need the properties to be defined in web.config, but only in the class.
But if I remove the properties from web.config I don't get the error anymore but I don't retrieve the values to (they are always blank)
Any idea?
is working on a reply...