ASP.net MVC ValidationSummary 始终呈现
我添加了 ASP.net MVC 验证摘要,即使首次加载页面并且 ModelState 有效时,它也会呈现此内容...
<div class="validation-summary-valid" data-valmsg-summary="true"><span>Errors</span>
<ul><li style="display:none"></li>
</ul></div>
文本“错误”并未隐藏! (它甚至没有样式,但这不是重点!)
如何使其在出现错误时仅显示验证摘要标题?
干杯,伊恩。
I've added an ASP.net MVC validation summary and even when the page is first loaded and when ModelState is valid it renders this out...
<div class="validation-summary-valid" data-valmsg-summary="true"><span>Errors</span>
<ul><li style="display:none"></li>
</ul></div>
The text 'Errors' is not hidden! (Its not even styled but that's not the point!)
How do I make it only show the validation summary heading when there's an error?
Cheers, Ian.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
validation-summary-valid
CSS 类在默认的 MVC /Content/Site.css 文件中定义为:...您确实在视图中引用了此文件吗?
The
validation-summary-valid
CSS class is defined in the default MVC /Content/Site.css file as:...do you definitely have a reference to this file in your View?