This question is locked. New answers and comments are not allowed.
The use of the following template prevents client validatation from running:
The partial view:
It all works fine, if you don't use a partial view like here:
This is not critical, but would make live much easier for me.
Besides from that, great components!
Kind Regards,
Michael
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %><% if (ViewData.TemplateInfo.TemplateDepth > 1) { %> <%= ViewData.ModelMetadata.SimpleDisplayText %><% } else { %> <table cellpadding="5" cellspacing="5" border="0"> <% foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !ViewData.TemplateInfo.Visited(pm))) { %> <% if (prop.HideSurroundingHtml) { %> <%= Html.Editor(prop.PropertyName) %> <% } else {%> <% Html.RenderPartial("~/Areas/Editor/Views/Shared/EditorTemplates/EditorRow.ascx", prop); %> <% }%> <% } %> </table><% } %>The partial view:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DataAnnotationsModelMetadata>" %><tr> <td> <div class="editor-label" style="text-align: right;"> <%= Model.IsRequired ? "*" : ""%> <%= Html.Label(Model.PropertyName)%> </div> </td> <td> <div class="editor-field"> <%= Html.Editor(Model.PropertyName)%> <%= Html.ValidationMessage(Model.PropertyName, "*")%> </div> </td></tr>It all works fine, if you don't use a partial view like here:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %><% if (ViewData.TemplateInfo.TemplateDepth > 1) { %> <%= ViewData.ModelMetadata.SimpleDisplayText %><% } else { %> <table cellpadding="0" cellspacing="0" border="0"> <% foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !ViewData.TemplateInfo.Visited(pm))) { %> <% if (prop.HideSurroundingHtml) { %> <%= Html.Editor(prop.PropertyName) %> <% } else { %> <tr> <td> <div class="editor-label" style="text-align: right;"> <%= prop.IsRequired ? "*" : "" %> <%= Html.Label(prop.PropertyName) %> </div> </td> <td> <div class="editor-field"> <%= Html.Editor(prop.PropertyName) %> <%= Html.ValidationMessage(prop.PropertyName, "*") %> </div> </td> </tr> <% } %> <% } %> </table><% } %>This is not critical, but would make live much easier for me.
Besides from that, great components!
Kind Regards,
Michael