diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml index 43ccd32ef6..1994917f2f 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml @@ -2,13 +2,12 @@ @using System.Web.Mvc.Html @using ClientDependency.Core.Mvc -@using umbraco.cms.businesslogic.member @using Umbraco.Web @using Umbraco.Web.Models @using Umbraco.Web.Controllers @{ - var profileModel = new ProfileModel(); + var profileModel = Members.CreateProfileModel(); Html.EnableClientValidation(); Html.EnableUnobtrusiveJavaScript(); @@ -17,10 +16,11 @@ Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js"); } -@if (Member.IsLoggedOn()) -{ - @Html.RenderJsHere() +@*NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed*@ +@Html.RenderJsHere() +@if (Members.IsLoggedIn()) +{ using (Html.BeginUmbracoForm("HandleUpdateProfile")) {
@@ -38,11 +38,11 @@ @Html.ValidationMessageFor(m => profileModel.Email)
- @for (var i = 0; i < profileModel.MemberProperties.Count; i++) + @foreach (var prop in profileModel.MemberProperties) { - @Html.LabelFor(m => profileModel.MemberProperties[i].Value, profileModel.MemberProperties[i].Name) - @Html.EditorFor(m => profileModel.MemberProperties[i].Value) - @Html.HiddenFor(m => profileModel.MemberProperties[i].Alias) + @Html.LabelFor(m => prop.Value, prop.Name) + @Html.EditorFor(m => prop.Value) + @Html.HiddenFor(m => prop.Alias)
} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml index ed7697721e..1994917f2f 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml @@ -1,14 +1,13 @@ -@inherits Umbraco.Web.Mvc.UmbracoTemplatePage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @using System.Web.Mvc.Html @using ClientDependency.Core.Mvc -@using umbraco.cms.businesslogic.member @using Umbraco.Web @using Umbraco.Web.Models @using Umbraco.Web.Controllers @{ - var profileModel = new ProfileModel(); + var profileModel = Members.CreateProfileModel(); Html.EnableClientValidation(); Html.EnableUnobtrusiveJavaScript(); @@ -17,10 +16,11 @@ Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js"); } -@if (Member.IsLoggedOn()) -{ - @Html.RenderJsHere() +@*NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed*@ +@Html.RenderJsHere() +@if (Members.IsLoggedIn()) +{ using (Html.BeginUmbracoForm("HandleUpdateProfile")) {
@@ -38,11 +38,11 @@ @Html.ValidationMessageFor(m => profileModel.Email)
- @for (var i = 0; i < profileModel.MemberProperties.Count; i++) + @foreach (var prop in profileModel.MemberProperties) { - @Html.LabelFor(m => profileModel.MemberProperties[i].Value, profileModel.MemberProperties[i].Name) - @Html.EditorFor(m => profileModel.MemberProperties[i].Value) - @Html.HiddenFor(m => profileModel.MemberProperties[i].Alias) + @Html.LabelFor(m => prop.Value, prop.Name) + @Html.EditorFor(m => prop.Value) + @Html.HiddenFor(m => prop.Alias)
} diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.config b/src/Umbraco.Web.UI/config/umbracoSettings.config index a467040eba..6cced72c73 100644 --- a/src/Umbraco.Web.UI/config/umbracoSettings.config +++ b/src/Umbraco.Web.UI/config/umbracoSettings.config @@ -87,7 +87,7 @@ - throw - Throw an exception which can be caught by the global error handler defined in Application_OnError. If no such error handler is defined then you'll see the Yellow Screen Of Death (YSOD) error page. Note the error can also be handled by the umbraco.macro.Error event, where you can log/alarm with your own code and change the behaviour per event. --> - inline + throw