Answer the question
In order to leave comments, you need to log in
Does Html.ValidationSummary not always work?
Good day.
The project has forms that are validated using the ValidationSummary - class (System.Web.UI.WebControls). For example,
@using (Html.BeginForm("Edit", "Account"))
{
@Html.ValidationSummary(true)
<td>@Html.LabelFor(model => model.MobilePhone)</td>
<td>
@Html.TextBoxFor(model => model.MobilePhone)
@Html.ValidationMessageFor(model => model.MobilePhone)
</td>
}
@Html.PopUpFormBegin("Edit", "Account")
@Html.ValidationSummary(false)
<tr>
<td>Дата открытия регистрации с</td>
<td>@Html.TextBoxFor(m => m.DateStart)
@Html.ValidationMessageFor(m => m.DateStart)</td>
</tr>
@Html.PopUpFormEnd()
Answer the question
In order to leave comments, you need to log in
Here's what your helper might look like, which can be used with using:
public static MvcForm PopUpForm(this HtmlHelper htmlHelper, string actionName, string controllerName, string validation = "", string idContent = null)
{
return htmlHelper.BeginForm(actionName, controllerName, FormMethod.Post, new { onSubmit="return PopUpWindow.ExecuteForm(this, '" + validation + "', '" + idContent + "');" });
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question