Updates MembershipHelper to not change the email/name if the value has not changed. Updates the templates to show only validation summaries for their own values/prefixes. Fixes some underlying MVC methods that merge view state to ensure the prefixes work with validation summaries properly when not showing property level errors. Updates the Umb controllers to add model level validation msgs when failed.

This commit is contained in:
Shannon
2014-02-10 18:34:12 +11:00
parent 0bfd032fad
commit ec08d3e910
9 changed files with 26 additions and 27 deletions

View File

@@ -14,24 +14,16 @@
Html.RequiresJs("/umbraco_client/ui/jquery.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
var success = TempData["ProfileUpdateSuccess"] != null;
}
@*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())
{
Html.EnableClientValidation();
Html.EnableUnobtrusiveJavaScript();
Html.RequiresJs("/umbraco_client/ui/jquery.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
var success = TempData["ProfileUpdateSuccess"] != null;
@*NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed*@
@Html.RenderJsHere()
{
if (success)
{
// This message will show if RedirectOnSucces is set to false (default)
@@ -43,7 +35,7 @@
<fieldset>
<legend>Edit profile</legend>
@Html.ValidationSummary(true)
@Html.ValidationSummary("profileModel", true)
@Html.LabelFor(m => profileModel.Name)
@Html.TextBoxFor(m => profileModel.Name)

View File

@@ -24,7 +24,7 @@
<fieldset>
<legend>Login</legend>
@Html.ValidationSummary(true)
@Html.ValidationSummary("loginModel", true)
@Html.LabelFor(m => loginModel.Username)
@Html.TextBoxFor(m => loginModel.Username)

View File

@@ -58,8 +58,8 @@ else
{
<fieldset>
<legend>Register Member</legend>
@Html.ValidationSummary(true)
@Html.ValidationSummary("registerModel", true)
@Html.LabelFor(m => registerModel.Name)
@Html.TextBoxFor(m => registerModel.Name)