Is it be possible to get and set Umbraco Member profile properties through razor script?
In the Umbraco Member section, under Member Types, I've added my property to the member type "Member".
What I've tried:
@using System.Web.Security;
@using System.Web.Profile;
...
var profile = ProfileBase.Create(username);
profile.SetPropertyValue("FirstName", "John"); // This is line 32 - error occures here.
profile.Save();
This error is throw in frontend:
Error Loading Razor Script (file: Create Account) The settings property 'FirstName' was not found. at System.Configuration.SettingsBase.SetPropertyValueByName(String propertyName, Object propertyValue)
at System.Configuration.SettingsBase.set_Item(String propertyName, Object value)
at System.Web.Profile.ProfileBase.SetInternal(String propertyName, Object value)
at System.Web.Profile.ProfileBase.set_Item(String propertyName, Object value)
at ASP._Page_macroScripts_CreateAccount_cshtml.Execute() in c:\project1\MacroScripts\CreateAccount.cshtml:line 32
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
Get and set member properties through razor
Is it be possible to get and set Umbraco Member profile properties through razor script?
In the Umbraco Member section, under Member Types, I've added my property to the member type "Member".
What I've tried:
This error is throw in frontend:
This is a bit old but will point you in the right direction :)
http://charlesafford.com/blog-folder/umbraco-members-and-aspnet-membership-provider-1-1/
is working on a reply...