asp.net-mvc – MVC DropDownListFor在视图中基本为True False

我正在尝试在MVC中设置一个基本的DropDownListFor:
@Html.DropDownListFor(modelItem => item.CheckerApproved,new SelectList(new SelectListItem { Text = "True",Value="1" },new SelectListItem { Text = "False",Value="0"}))

这是我认为的,我想要的是一个基本的true和false下拉列表,值分别为1和0.

我认为我错误的部分是将项添加到SelectList构造函数中.

有人可以帮我这个吗?

解决方法

试试这个:
@Html.DropDownListFor(modelItem => modelItem.CheckerApproved,new [] { new SelectListItem { Text = "True",Value="0"} })

相关文章

一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....
推荐一款比较牛的富文本编辑器:http://kindeditor.net/
一、异或运算异或,英文为exclusive OR,或缩写成xor异或(x...
一、云计算概念 云计算(cloud computing)是基于互联网的相...