The error would most likely come from the member not having a property with that alias. Double-check that you have a property called "isDisabled" - it is case-sensitive too.
I am trying to perform this task within a MVC3 application which is a sub application within my umbraco site. I have succesfuly intgrated the Umbraco membership provider and I can use this within my MVC application. But still can't access properties of members as described previously.
I have just created a user control that I have implemented on my umbraco site (not the sub application) using the exact same code as described earlier. and I am able to access the properties with no problem.
It is only within the sub appliation that I get this error.
Setting Member Property
I am having a bit of trouble trying to access/edit Umbraco Member properties.
I have created a property in Umbraco for my members and I can set this fine using the Umbraco Backend.
However, I am trying to to access/edit these properties within my own code.
Member umbracoUser = new Member(1077);
umbracoUser.getProperty("isDisabled").Value = "1";
When assiging the value to the property I get an error saying
Object reference not set to an instance of an object.
I can get access to everything else on the umbracoUser object, such as LoginName and Email etc, but cant get the properties that I have created.
Hi xrisdoc, welcome to the forum!
The error would most likely come from the member not having a property with that alias. Double-check that you have a property called "isDisabled" - it is case-sensitive too.
Cheers, Lee.
Thanks for your reply.
There is definitely a property called "isDisabled". I have even tried copy and paste just to make sure.
Ok, i've just noticed something.
I am trying to perform this task within a MVC3 application which is a sub application within my umbraco site. I have succesfuly intgrated the Umbraco membership provider and I can use this within my MVC application. But still can't access properties of members as described previously.
I have just created a user control that I have implemented on my umbraco site (not the sub application) using the exact same code as described earlier. and I am able to access the properties with no problem.
It is only within the sub appliation that I get this error.
Thanks,
is working on a reply...