开发者

How to Determine ASP.NET MVC 1.0 Validation State inside the View

开发者 https://www.devze.com 2022-12-19 19:12 出处:网络
I need to customize the validation message style. The way I am approaching this is to wrap the ValidationSumma开发者_StackOverflow社区ry helper with a styled div. The problem I have is that the div is

I need to customize the validation message style. The way I am approaching this is to wrap the ValidationSumma开发者_StackOverflow社区ry helper with a styled div. The problem I have is that the div is visible even when there is no error on the page. Is there a way to determine if the ModelState has an error inside the view? Or should I approach this problem some other way.

Thank You!


This doesn't work? ViewData.ModelState.IsValid

0

精彩评论

暂无评论...
验证码 换一张
取 消