I have a view with two forms each containing their own
@Html.ValidationSummary()
When the page is loaded, a querystring parameter is checked and if it exists I call:
ModelState.AddModelError("", "Querystring error");
However, this results in the error message appearing in both @Html.ValidationSummary()
even if I specify a property in the form model.
I have a work around which is to have a seperate error message property in the model for the form and populate that and then display it if it exists in a label, but wondered if it is possible to specify one individual @Html.ValidationSummary()
within a form to allow me to use ModelState.AddModelError
?