Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've posted in an other thread but that is for 4.11 (and i'm using 6.0.2 with Mvc enabled) and I could not find a way to delete the reply.
I have implemented a Surface controller to login a member and redirect it to a specific page. I want to decide which page to redirect to upon the property value of a member (using membertype/profile property with content picker datatype).
I did not succeeded though using the ASP.NET Membership Profile Provider. The only thing I can find is to Create and Save the property, but I only want to GET the property value.
There's no such method as MembershipUser.GetProperty("somepropertyname")...
The next code I used successfully, but this is with the deprocated method "Member.GetMemberByName". How would anyone rewrite it using the ASP.NET profile providers? Or else maybe some docs, or a ubraco.tv thingy covering this?
Ok already solved it!
I was missing the custom default provider for the profile in the web.conf and needed to set the property there, another way is to set this property is to create a class which inherits from Providerbase and add a property there:
<!-- Profile provider-->
<profile defaultProvider="UmbracoMemberProfileProvider" enabled="true" inherits="UmbracoFramework.Models.MemberProfile, UmbracoFramework">
<add name="UmbracoMemberProfileProvider" type="umbraco.providers.members.UmbracoProfileProvider, umbraco.providers" />
<add name="home" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.String" />
Now it works like this:
public ActionResult HandleMemberLogin(MemberLogin model)
if (Membership.ValidateUser(model.Username, model.Password))
ModelState.AddModelError("Username", "Gebruikersnaam of wachtwoord is onjuist.");
var memberProfile = ProfileBase.Create(model.Username);
var propertyValue = memberProfile.GetPropertyValue("home");
if (propertyValue != null)
int pageId = Convert.ToInt32(propertyValue);
you can just use:
you probably want to declare that "home" as a const string rather that putting it straight in :).
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted