Specify validation summary on multiple forms

前端 未结 4 1148
甜味超标
甜味超标 2020-12-10 10:18

I have 2 forms on a page as follows:

@using (Html.BeginForm())
{
    @Html.ValidationSummary()
    @Html.Label(\"code\", \"Confirmation Code\")
    @Html.Tex         


        
4条回答
  •  佛祖请我去吃肉
    2020-12-10 11:13

    Html.ValidationSummary() does not need to be inside of your form element and you only need it the once int most cases. I'd move it outside of your two forms, something like just above your main body content and that should give you the desired effect. I believe in my last app I placed it in the Layout file.

提交回复
热议问题