Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 133225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:23:34+00:00 2026-05-11T06:23:34+00:00

I have a strange problem whereby the ValidationSummary is not being displayed. However, the

  • 0

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?

Edit: Break point set at ValidationSummary shows:

ViewData.ModelState.Values[1].ErrorMessage = '' ViewData.ModelState.Values[1].Exception.InnerException.Message = '4a is not a valid value for Int32' 

Does ValidationSummary use ErrorMessage and ValidationMessage use InnerException.Message?

My view code is:

<%@ Page Title='' Language='C#' MasterPageFile='~/Views/Shared/Site.Master' Inherits='System.Web.Mvc.ViewPage<App.Models.PurchaseOrdersView>' %>   <asp:Content ID='Content1' ContentPlaceHolderID='head' runat='server'>     <title>Edit</title> </asp:Content>  <asp:Content ID='Content2' ContentPlaceHolderID='MainContent' runat='server'>      <h2>Edit</h2>      <%= Html.ValidationSummary() %>      <% Html.BeginForm('Edit', 'PurchaseOrder', FormMethod.Post); %>     <table>         <tr>             <td>                 Purchase Order Id:             </td>             <td>                 <%= Html.TextBox('PurchaseOrderId', Model.PurchaseOrderId)%>                 <%= Html.ValidationMessage('PurchaseOrderId')%>             </td>         </tr>         <tr>             <td>                 Date:             </td>             <td>                 <%= Html.TextBox('Date', Model.Date.ToString('dd-MMM-yyyy'))%>                 <%= Html.ValidationMessage('Date')%>             </td>         </tr>     </table>     <input type='submit' value='Save' />      <% Html.EndForm(); %>  </asp:Content> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:23:35+00:00Added an answer on May 11, 2026 at 6:23 am

    You don’t say what the errors are that are not displaying, but there are some errors which will be displayed in ValidationMessage but not in ValidationSummary. I think that this is a bug in the Release Candidate, but I am open to other interpretations. In particular, consider this line from the ValidationSummary source code:

    string errorText = GetUserErrorMessageOrDefault(modelError, null /* modelState */); 

    Note that nothing is passed for modelState. Now contrast that with ValidationMessage:

    ... GetUserErrorMessageOrDefault(modelError, modelState) ... 

    Finally, let’s look at GetUserErrorMessageOrDefault:

        private static string GetUserErrorMessageOrDefault(ModelError error, ModelState modelState) {         if (!String.IsNullOrEmpty(error.ErrorMessage)) {             return error.ErrorMessage;         }         if (modelState == null) {             return null;         }          string attemptedValue = (modelState.Value != null) ? modelState.Value.AttemptedValue : null;         return String.Format(CultureInfo.CurrentCulture, MvcResources.Common_ValueNotValidForProperty, attemptedValue);     } 

    What this tells us is that if you specify a custom error message when you add an error to the model state, it will be displayed. If, however, an exception is added (there is one overload for AddModelError which takes an exception, another which takes a string; implementing IDataErrorInfo works like the string case), instead of a string error message, it will only be displayed if modelState is non-null, and then we’ll give you a generic message instead of the error message on the exception.

    Update

    Does ValidationSummary use ErrorMessage and ValidationMessage use InnerException.Message?

    Yes, that’s more or less the effect. Like I said, I think this is a bug.

    Update2

    Microsoft updated the GetUserErrorMessageOrDefault function as seen here.

    private static string GetUserErrorMessageOrDefault(HttpContextBase httpContext, ModelError error, ModelState modelState)     {         if (!String.IsNullOrEmpty(error.ErrorMessage))         {             return error.ErrorMessage;         }         if (modelState == null)         {             return null;         }          string attemptedValue = (modelState.Value != null) ? modelState.Value.AttemptedValue : null;         return String.Format(CultureInfo.CurrentCulture, GetInvalidPropertyValueResource(httpContext), attemptedValue);     } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem where a XAML control is not visible in the
I have a problem whereby a vector of pointers does not seem to be
I have some strange problem with PIL not resizing the image. from PIL import
i have strange problem doing reporting: i have numerous clients with different issued invoices.
I have strange problem with receiving data from socket. On client im using air
I have a strange problem on ipv6 connection. I write down a simple client
I have a strange problem with IE. I have a sequence of forms on
I have a strange problem with in-app billing RESTORE_TRANSACTION command. Every request RESTORE_TRANSACTION request
I have a strange problem getting the color of the point that was touched.
I have a strange problem with integrating a ViewController into another ViewController . i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.