![]() |
个性的小蝌蚪 · 面试官:Redis的事务满足原子性吗? - ...· 3 月前 · |
![]() |
大气的木瓜 · python把日期数据转换成数字 ...· 1 年前 · |
![]() |
潇洒的斑马 · 迁移详细信息 - Microsoft ...· 1 年前 · |
![]() |
知识渊博的刺猬 · 用singularity来管理软件 - 知乎· 1 年前 · |
我的MVC4应用程序中有以下代码行,它是从MVC3转换而来的:
@Html.HiddenFor(model => model.IsInhouse) // IsInhoue is bool
当应用程序是MVC3时,它工作得很好,但现在它发生了故障。
我尝试使用@Html.LabelFor(model => model.IsInhouse)显示值,它显示为'IsInhouse',而不是内容值。
关于这个问题的任何线索都是有价值的。我是MVC的新手。
编辑:用
<input type="hidden" name="IsInhouse" value="@Html.AttributeEncode(Model.IsInhouse)" id="IsInhouse" />
替换@Html.HiddenFor解决了这个问题。
发布于 2013-11-04 13:49:53
LabelFor
会显示它的属性名,这就是它的目的。要获取它的值,请使用
EditorFor
https://stackoverflow.com/questions/19762103
复制相似问题
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2023 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号: 粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287