【发布时间】:2012-01-10 09:41:54
【问题描述】:
在我的模型中,我有一个 int 对象和一个布尔数组:
public class mymodel
{
public int Round { get; set; }
public Boolean[] lstLabs { get; set; }
}
在我看来,我是这样写的:
<script type="text/javascript">
var objModel = {
Round:"@Model.Round",
lstLabs: "@Model.lstLabs"
};
</script>
我只得到 Round (the int object) 的值,但我无法得到数组,我只得到这个:lstLabs : System.Boolean[],我试过了:lstLabs: @Model.lstLabs.slice() 但它没有用,我得到了同样的东西......
谁能帮帮我?
提前致谢。
【问题讨论】:
标签: javascript asp.net-mvc-3 view model razor