开发者

MVC 2 Validation works intermittently with listbox

开发者 https://www.devze.com 2023-01-27 02:54 出处:网络
I got a model with a string property that is required 开发者_运维百科defined as so: [Required(ErrorMessage=\"Party one is required\")]

I got a model with a string property that is required 开发者_运维百科defined as so:

[Required(ErrorMessage="Party one is required")]
public string PartyOne { get; set; }

In my view I have a

<%: Html.ListBoxFor(model => model.PartyOne, ListSource) %>
<%:Html.ValidationMessageFor(model => model.PartyOne)%>

It's acting funky. When I run locally in IE works fine. When I run on the production URL it works fine in Chrome and Firefox, but in IE the selection of the listbox is not sticking, resulting in the above validation error message.

I'm completely stumped. Help?


I found the issue. It's client side validation. I had it turned on in the master page, and apparently it's funky in IE or something.

0

精彩评论

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

关注公众号