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 9135951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:53:22+00:00 2026-06-17T08:53:22+00:00

I have a very strange issue with IE and ASP.NET MVC 4 Data Annotations.

  • 0

I have a very strange issue with IE and ASP.NET MVC 4 Data Annotations.

Some of them seem to be showing their server side error messages on the initial page load only in IE (9 and 9 in 8/7 standards mode). The ones affected seem to be some StringLength and RegularExpression but not all I have other Data Annotations e.g. Required which are not showing their messages.

I have customised how validation messages are inserted client side so they are definitely server side errors.

Does anyone have any idea why this might happen? I am completely confused.

I have tried calling ModelState.Clear() in my action method but this does not seem to resolve the issue..

I am using the P-R-G pattern but the G part which renders my form is a child action, could this be the issue?

Code in response to comment:

    public ActionResult MyForm()
    {
        var cp = GetComponentPresentation();

        var model = new MyFormModel(cp);
        model.ComponentId = cp.Component.Id;
        LoadModel(model);
        return PresentationView(model);
    }

    private void LoadModel(MyFormModel model)
    {
        string titleTypesTcmId = ConfigHelper.TitleTypesKeywordId.FormatWith(ConfigHelper.PublicationId);
        model.TitleKeywords = TaxonomyService.GetTaxonomyKeywordChildrenNames(titleTypesTcmId)
                                .Select(x => new SelectListItem() { Text = x, Value = x }).ToList();
    }

The View Html is 250 lines and I don’t have time to anonymise it. So here is a snippet of one of the text boxes that seems to be failing validation.

<div class="row">
    @using (Html.BeginForm("MyForm", "MyFormController", FormMethod.Post, new { id = "MyForm", @class = "form ajax", data_ajax_error=Html.GetPlainTextValue(Model.Component, "error_message") }))
    {
            <input type="hidden" name="ComponentId" value="@Model.Component.Id"/>
            <fieldset class="paddingright">
               <legend>Your Details</legend>
               <div class="row field">
                   @Html.LabelForRequired(m => m.NationalInsuranceNumber, Html.Resource("Labels_Form_NINumber"))
                   @Html.TextBoxFor(m => m.NationalInsuranceNumber, new { placeholder=Html.Resource("Placeholder_Form_NINumber") })
                   @Html.ValidationMessageFor(m => m.NationalInsuranceNumber, null, new { @class = "error"})
                </div>
                <!-- SNIP -->
                <div class="submit-container no-js-hidden">
                   <button type="submit" value="Step2" class="btn-green customsubmit" name="FormButton">
                       <span class="content">Next step &gt;</span>
                   </button>
                </div>
             </fieldset>
     }
  • 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. Editorial Team
    Editorial Team
    2026-06-17T08:53:22+00:00Added an answer on June 17, 2026 at 8:53 am

    This was actually a client side thing, dispite what I thought.

    It was caused by my IE placeholder fallback script triggering “change” on the textboxes causing validation to fire as the validation script was loading, which was causing some very strange results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very strange routing issue. I have a ASP.NET MVC 3 site
I have a strange issue with an Asp.NET MVC application. Using Asp.NET MVC 3
Having a very strange issue regarding postback in ASP.NET. I have page dynamically populating
I have this very strange issue with my MVC 2 project. Often times, I'll
I have encountered a very strange issue. Whenever I use the .NET membership provider
We have a very strange issue that we're dealing with. We have an MVC
I have a very strange issue that only affects webkit browsers for some reason,
I have a very strange issue with the tableview: I have a table cell
I have a very strange issue. I have an open WebSocket, the communication works
I have a very strange issue on my hands. I have two IIS websites

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.