RadioButtonFor绑定值

<div class="form-group">
            <label class="control-label col-md-2">是否</label>
            <div class="col-md-10">
                @Html.RadioButtonFor(model => model.IsRecord, "0", new { @id = "Mode0", @name = "Mode", @value = "0", @checked = (Model.IsRecord == "0" ? "checked" : "") }) 否
                @Html.RadioButtonFor(model => model.IsRecord, "1", new { @id = "Mode1", @name = "Mode", @value = "1" , @checked = (Model.IsRecord == "1" ? "checked" : "") }) 是

            </div>
        </div>

  

posted @ 2016-01-07 11:33  幸运的程序员  阅读(410)  评论(0编辑  收藏  举报