.Net mvc 中的單選按鈕 顯示與添加

添加:spa

<div class="checkbox">
                    @Html.RadioButtonFor(Model => Model.Sex_State, true, new { @id = "Sex_State", @name = "Status" }) 男

                    @Html.RadioButtonFor(Model => Model.Sex_State, false, new { @id = "Sex_State", @name = "Status" }) 女
                </div>

顯示:code

@{ 
                if (item.Sex_State == true)
                {
                    <p>男</p>
                }
                else
                {
                    <p>女</p>
                }
            }
相關文章
相關標籤/搜索