1

我有两个 Kendo 复选框,我想验证它,因为至少需要检查其中一个。

 <h4>Choose your favorite dance form</h4>
    <div class="form-group">

        <div class="col-md-6">
            @(Html.Kendo().CheckBoxFor(e => e.Salsa)
    .Name("Salsa")
    .Label("Salsa"))
            <br />
            @(Html.Kendo().CheckBoxFor(e => e.Latin)
    .Name("Latin")
    .Label("Latin"))
        </div>
    </div>

下面是我的属性是如何在我的模型中定义的:

        public bool Salsa { get; set; }

        public bool Latin { get; set; }

我如何对它们进行数据注释,以便至少需要进行一次验证。

谢谢!

4

0 回答 0