📜  如何以 C# 形式从 cshtml 发送带有 newselectList 的布尔值 - Html 代码示例

📅  最后修改于: 2022-03-11 14:53:10.409000             🧑  作者: Mango

代码示例1
You can try something like here:

<%= Html.DropDownList(
    "", 
    new SelectList(
        new[] 
        { 
            new { Value = "true", Text = "Yes" },
            new { Value = "false", Text = "No" },
        }, 
        "Value", 
        "Text",
        Model
    )
) %>