开发者

MVC 2 Validation works intermittently with listbox

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜