I'm trying to access custom Membership properties but since upgrading to umbaco 4.7 the GenericProperties collections seems to be empty. Anybody else having this?
Here is my Razor snippet that fails to show the many member properties:
@using umbraco.cms.businesslogic.property;
@using umbraco.cms.businesslogic.member;
@{
var mu = Membership.GetUser("yannicksmits");
var m = new Member((int)mu.ProviderUserKey);
}
<h3>@m.Text</h3>
@foreach (Property p in m.GenericProperties)
{
if (!String.IsNullOrEmpty(p.Value.ToString()))
{
<p>@p.PropertyType.Alias = @p.Value.ToString()</p>
}
}
also tried it the old way (m.getProperty("propname")) without success.
I was going to say, this code looks correct. Are you sure the user existed before and that mu.ProviderUserKey was returning a value?
Maybe it was a weird caching issue, might want to try Start > Run > iisreset and then immediately load the page with this razor macro on it, maybe you can reproduce it.
Can't access custom Membership properties
I'm trying to access custom Membership properties but since upgrading to umbaco 4.7 the GenericProperties collections seems to be empty. Anybody else having this?
Here is my Razor snippet that fails to show the many member properties:
also tried it the old way (m.getProperty("propname")) without success.
And all of a sudden, without changing anything the above snippet started to work?!?!! what is happening here?
I was going to say, this code looks correct. Are you sure the user existed before and that mu.ProviderUserKey was returning a value?
Maybe it was a weird caching issue, might want to try Start > Run > iisreset and then immediately load the page with this razor macro on it, maybe you can reproduce it.
also have the same problem with my wcf accessing the getProperty method from Member... can somebody help with this?
var member = Member.GetMemberFromLoginAndEncodedPassword("user", @"8alEu4v0ZrvHPaY4LlKDOEo+Rmo=");
var fullName = member.getProperty("fullName").Value; // CANNOT BE ACCESSED
var userGroup = member.getProperty("userGroup").Value; // CANNOT BE ACCESSED
is working on a reply...