MVC3 Jquery UI 按钮复选框显示错误的主题颜色
当传递到视图时,我的模型将我的 bool 属性显示为 false,但视图随后将按钮显示为“已检查”状态,尽管当我通过控制器提交表单时底层状态仍然为 false...有什么想法吗?
这是我的index.cshtml
<script type="text/javascript">
$(document).ready(function(){
$(".chk").button();
});
</script>
@Html.CheckBoxFor(m => m.IsAnyDateJoined, new { @class="chk" })
@Html.LabelFor(m => m.IsAnyDateJoined)
因此,正如所解释的,为什么我的模型显示 IsAnyDateJoined (bool=false) 尽管我看到“checked/true”复选框状态,但底层 Model bool 仍然呈现为 false ?
IsAnyDateJoined: False
从用户界面的角度来看非常混乱。非常感谢任何帮助。
My model shows my bool property as false when passed into the View but the view then shows the button in a 'checked' state although the underlying state is still false when I submit the form back through the controller... any ideas?
Here's my index.cshtml
<script type="text/javascript">
$(document).ready(function(){
$(".chk").button();
});
</script>
@Html.CheckBoxFor(m => m.IsAnyDateJoined, new { @class="chk" })
@Html.LabelFor(m => m.IsAnyDateJoined)
So, as explained, why does my model show IsAnyDateJoined (bool=false) although I see the 'checked/true' checkbox state, the underlying Model bool is still rendered as false ??
IsAnyDateJoined: False
Very confusing from a UI perspective. Any help much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这个论坛帖子可能会回答您的问题: http://forums.asp.net/t/1314753 .aspx
I think this forum thread may answer your question: http://forums.asp.net/t/1314753.aspx