Slee
Slee

Reputation: 28248

multiple Html.ValidationSummary's in a single .Net MVC page?

Is it possible to have multiple Html.ValidationSummary's in a single .Net MVC page?

I have a create user and a login form on the same page and would like to have to summaries

Upvotes: 2

Views: 1132

Answers (2)

Thomas Eyde
Thomas Eyde

Reputation: 3934

You can always create your two summaries and stuff them in your view model. Then create a partial view to display the summaries.

Upvotes: 1

Jason Wicker
Jason Wicker

Reputation: 3456

You can, but they will both display the same ModelState validation errors, which may not be what you want. You may want to create special ViewData items to present the errors separately.

Upvotes: 1

Related Questions