Scanning for LeafWeb data submission errors
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
@model Boolean?
|
||||
|
||||
@{
|
||||
Layout = "_FieldLayout.cshtml";
|
||||
|
||||
var htmlAttributes = new RouteValueDictionary();
|
||||
if (ViewBag.@class != null)
|
||||
{
|
||||
htmlAttributes.Add("class", ViewBag.@class);
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.HasValue && Model.Value)
|
||||
{
|
||||
<input id="@ViewData.TemplateInfo.GetFullHtmlFieldId("")" name="@ViewData.TemplateInfo.GetFullHtmlFieldId("")"
|
||||
type="checkbox" checked="checked" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input id="@ViewData.TemplateInfo.GetFullHtmlFieldId("")" name="@ViewData.TemplateInfo.GetFullHtmlFieldId("")"
|
||||
type="checkbox" />
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<ul class="d-none">
|
||||
@foreach (var ms in ViewData.ModelState)
|
||||
{
|
||||
<li>@ms.Key
|
||||
<ul>
|
||||
<li>@ms.Value.Value.AttemptedValue</li>
|
||||
@foreach (var valueError in ms.Value.Errors)
|
||||
{
|
||||
<li class="text-danger">Error: @valueError.ErrorMessage</li>
|
||||
<li class="text-danger">Ex: @valueError.Exception.Message</li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
@@ -11,6 +11,7 @@
|
||||
var actionName = string.Empty;
|
||||
var controllerName = string.Empty;
|
||||
var htmlFormAction = string.Empty;
|
||||
var admin = false;
|
||||
|
||||
if (ViewData.ContainsKey("actionName"))
|
||||
{
|
||||
@@ -24,6 +25,10 @@
|
||||
{
|
||||
htmlFormAction = (string)ViewData["htmlFormAction"];
|
||||
}
|
||||
if (ViewData.ContainsKey("admin"))
|
||||
{
|
||||
admin = true;
|
||||
}
|
||||
}
|
||||
@using (Html.BeginUmbracoForm(actionName, controllerName, null, new { action = htmlFormAction, id = "leafdataquery" }))
|
||||
{
|
||||
@@ -101,6 +106,14 @@
|
||||
@Html.EditorFor(m => m.compl)
|
||||
</div>
|
||||
</div>
|
||||
@if (admin)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@Html.EditorFor(m => m.erred)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user