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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:59:28+00:00 2026-05-28T05:59:28+00:00

I have 2 validation forms on page. <div id=’LogOn’ style=background-color: White;> @using (Ajax.BeginForm(LogOnAjax, Home,

  • 0

I have 2 validation forms on page.

<div id='LogOn' style="background-color: White;">
    @using (Ajax.BeginForm("LogOnAjax", "Home", new AjaxOptions { UpdateTargetId = "LogOn", OnSuccess = "logInComplete" }))
    { 
        //ITW2012Mobile.ViewModels.LogOnModel m = Model;
        @Html.HiddenFor(model => model.IsLoggedIn)
        @Html.HiddenFor(model => model.ReturnUrl)
        <div>
            @Html.ValidationSummary()
        </div>
        <div>
            @Html.LabelFor(model => model.UserName)
            @Html.EditorFor(model => model.UserName)
        </div>
        <div>
            @Html.LabelFor(model => model.Password)
            @Html.EditorFor(model => model.Password)
        </div>
        <div>
            <input type="submit" value="Login" />
        </div>
    }
</div>

and

<fieldset>
    @using (Html.BeginForm(Model.ActionMethod, Model.Controller))
    {
        @Html.ValidationSummary()
.....
            <div class="display-label"> E-mail Address * </div>
            <div class="display-field">
            @Html.EditorFor(model => model.Username)
            @Html.ValidationMessageFor(model => model.Username)
            </div>
            <div class="display-label"> Create Password * </div>
            <div class="display-field">
            @Html.PasswordFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
            </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    }
</fieldset>

How can I mark that ModelState.AddModelError is for first of form, because I see the same error in the both places of validation summary?

  • 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-28T05:59:29+00:00Added an answer on May 28, 2026 at 5:59 am

    How can I mark that ModelState.AddModelError is for first of form

    You can’t.

    What you can do is having ValidationMessageFor for each form properties instead of the ValidationSummary

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

Sidebar

Related Questions

I have many forms that use AJAX (w/ jQuery) for validation and data submission.
I'm using the jQuery Validation JS I have two contact forms, the main one
I have a form on my PHP page which performs some ajax validation (that's
Let's say I have a page using the Validation Plugin more or less as
I have a multi-lingual page where I want to display form validation error in
I am using jquery validation plugin for form validation. I have added a custom
I have a small jQuery plugin that I use for form AJAX validation. There
We have an ASP.NET web forms application which occasionally generates a validation error like
I have forms inside a cakephp app that load through ajax. These forms have
I'm using jqTransform to style my forms which works very well. However, when 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.