我有一些预订电影票的代码。如果有人已经订了票,他可以订更多票,只有当有特定的错误信息时。
此 var validationSummary 仅接收标签 ( <span class="field-validation-valid" data-valmsg-for="Saving" data-valmsg-replace="true"></span>
)。但是在网页中@validationSummary 打印出正确的信息。
我怎样才能并且可以访问错误消息的文本以完全检查它?
@{
@Html.ValidationSummary(true)
var validationSummary = Html.ValidationMessage("Saving");
bool buyAnotherVal = validationSummary.ToString().Contains("By continuing this form, you will booking another some tickets");
}
@using ( Html.BeginUmbracoForm<MovieBookingSurfaceController>( "SubmitBuyerDetails", new { buyAnother = buyAnotherVal }) )
{
@validationSummary