public static MvcHtmlString NamedValidationSummary(this HtmlHelper htmlHelper, string formName, bool excludePropertyErrors, string message, IDictionary <string, object> htmlAttributes) { return(StringExtensions.AreEqual(htmlHelper.ViewData[SubmittedFormName] as string, formName) ? htmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes) : new MvcHtmlString(string.Empty)); }
public static bool IsFormValid(this HtmlHelper htmlHelper, string formName) { return(htmlHelper.ViewData.ModelState.IsValid || !StringExtensions.AreEqual(htmlHelper.ViewData[SubmittedFormName] as string, formName)); }