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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:32:18+00:00 2026-05-31T02:32:18+00:00

When my page loads my ValidationSummary and ValidationMessageFor(model => model.TestNumbersString) both display the validation

  • 0

When my page loads my ValidationSummary and ValidationMessageFor(model => model.TestNumbersString) both display the validation error despite just barely loading the page. I have checked that the .css file is referenced in my _Layout.cshtml and the styles exist for it.

Model.cs

[Required]
public string TestNumbersString { get; set; }

HomeController.cs

public ActionResult Index(TestModel model)
{
    return View(model);
}

partialView.cshtml

@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { @class = "form" }))
{
    @Html.TextAreaFor(model => model.TestNumbersString, new { @class = "testBox" })
    @Html.ValidationMessageFor(model => model.TestNumbersString)
}

My Layout I noticed has a number of javascript and css files, but other validation works on the page, AND I know that the site.css is loaded for other parts of the page (but not for my form, but that’s another problem).

_Layout.cshtml

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

The troubleshooting I’ve done so far has lead me to find that the class for the validation message is field-validation-error. So I am lead to believe it’s not a .css error (even though the css styling isn’t applying correctly).

I also want to be clear that this is a partial layout. I’m not sure if this would cause additional problems when dealing with validation.

EDIT: Solution

Thanks to @jacqijvv for the solution.

public ActionResult Index()
{
    TestModel model = new TestModel();
    return View(model);
}

[HttpPost]
//We have these separate as this is the design for MVC.
public ActionResult Index(TDMixParametersViewModel model)
{
    if (ModelState.IsValid)
        return View(model);
    else
    {
        model = new TDMixParametersViewModel();
        return View(model);
    }
}
  • 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-05-31T02:32:19+00:00Added an answer on May 31, 2026 at 2:32 am

    Remove the parameter from the action method call

    E.g.

        public ActionResult Index()
        {
            TestModel model = new TestModel();
            return View(model);
        }
    

    That should fix the problem

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

Sidebar

Related Questions

I have a stripes action page. and When the page loads, I want to
I'm trying to have a site set up so when the page loads there
I have a div (.header) contained within other divs. When my page loads, momentarily
I want to display the datepicker when page loads $(#dp).datepicker(show) ; but it is
My html page loads beautifully, but I have some JavaScript that adds a few
I have this when the page loads <input class=input id=accountNameUsernameForm_name name=profile[real_name] size=30 type=text value=George>
I have button with id = new which loads the new page $(#new).click(function(){ $('#message_area').load('new.php');
I have a nav button that loads a new page (create.html.erb) through Lightbox 2.
I have the importcsv module installed and the importcsv page loads fine. The file
I have some divs that when the page loads are populated with images of

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.