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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:18:14+00:00 2026-06-19T03:18:14+00:00

this is my first question on stackoverflow, so please be kind if I should

  • 0

this is my first question on stackoverflow, so please be kind if I should be missing something.
I have two forms, each linked to its own action (for data modification) combined in a single view. Currently, I am using partials and a parent model which consists of the two models assigned to the forms.

My main view looks a bit like this:

@model ReportingUploadPortal.Models.ManageUserDataModel
@Html.Partial("_ChangePasswordPartial", Model.PasswordModel)
@Html.Partial("_ChangeEMailPartial",Model.EmailModel)

My parent model is this:

public class ManageUserDataModel
{
    public ChangeEmailModel EmailModel { get; set; }
    public LocalPasswordModel PasswordModel { get; set; }
}

I get the validation summary information displayed two times, for each of my two partial views (they are very similar). It seems the validation information is tied to the parent model, not to each of the two child models.

@using (Html.BeginForm("ChangeEmail", "Account")) {
@Html.AntiForgeryToken()
@Html.ValidationSummary()

<fieldset>
    <legend>Change your email</legend>
    <ol>
        <li>
            @Html.LabelFor(m => m.EMail)
            @Html.TextBoxFor(m => m.EMail)
        </li>
        <li>
            @Html.LabelFor(m => m.ConfirmEMail)
            @Html.TextBoxFor(m => m.ConfirmEMail)
        </li>
    </ol>
    <input type="submit" value="Change email" />
</fieldset>

}

How can I get a seperate validation summary for each form/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-06-19T03:18:15+00:00Added an answer on June 19, 2026 at 3:18 am

    The @Html.ValidationSummary() is just that a summary. It is actually a list of errors which is on the model. So I believe that each model should have it’s own summary (not certain about this).

    I believe that you are getting duplicate summaries because you have this line: @Html.ValidationSummary() in each form in each partial view. Every time you have this line it will print out the whole summary to the page. You can change the granularity of the summaray with some flags, but there are also alternatives to using the whole summary e.g. @Html.ValidationMessage().

    Hope that helps!

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

Sidebar

Related Questions

This is my first post on stackoverflow, so please excuse me if my question
I'm fairly new to Objective-C, and this is my first question on StackOverflow. Please
This is the first time I am posting a question on stackoverflow, so please
This is my first question on Stack Overflow. Please be kind on my mistakes.
This is my very first question on Stackoverflow, so please bear with me if
This is my first question asked here at stackoverflow, so bear with me please
This is my first question on stackoverflow, so please bear with me if I
This is my first question on StackOverflow, can you please explain to me what
Greetings everyone. This is my first question here at stackoverflow so please bear with
This is my first question on StackOverFlow so please let me know if 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.