Note that there are some explanatory texts on larger screens.

plurals
  1. POasp.net MVC - ValidationSummary not displaying
    text
    copied!<p>I have a strange problem whereby the ValidationSummary is not being displayed. However, the ValidationMessage's are being displayed. I've checked the output page source and it's not as though they are in a colour that is obscuring them. I'm using the RC. Any ideas?</p> <p>Edit: Break point set at ValidationSummary shows:</p> <pre><code>ViewData.ModelState.Values[1].ErrorMessage = "" ViewData.ModelState.Values[1].Exception.InnerException.Message = "4a is not a valid value for Int32" </code></pre> <p>Does ValidationSummary use ErrorMessage and ValidationMessage use InnerException.Message?</p> <p>My view code is:</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;App.Models.PurchaseOrdersView&gt;" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt; &lt;title&gt;Edit&lt;/title&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt; &lt;h2&gt;Edit&lt;/h2&gt; &lt;%= Html.ValidationSummary() %&gt; &lt;% Html.BeginForm("Edit", "PurchaseOrder", FormMethod.Post); %&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; Purchase Order Id: &lt;/td&gt; &lt;td&gt; &lt;%= Html.TextBox("PurchaseOrderId", Model.PurchaseOrderId)%&gt; &lt;%= Html.ValidationMessage("PurchaseOrderId")%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; Date: &lt;/td&gt; &lt;td&gt; &lt;%= Html.TextBox("Date", Model.Date.ToString("dd-MMM-yyyy"))%&gt; &lt;%= Html.ValidationMessage("Date")%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;input type="submit" value="Save" /&gt; &lt;% Html.EndForm(); %&gt; &lt;/asp:Content&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload