I have the following code to generate an html input and validation message.
@Html.ValidationSummary(false)
......
<div class="col-md-10">
@Html.TextBoxFor(model => model.ImageUpload, new { type = "file", name = "file" })
@Html.ValidationMessageFor(model => model.ImageUpload)
</div>
In my action I have the code
if (.... something wrong with the input ....)
{
ModelState.AddModelError("", "Invalid image file.");
return RedirectToAction(....
However, it will show an error message in the validation summary section. Is it possible to show the error message in the validation message section for input too?