• mvc 设置select项选中


                            <select id="FloorType" name="FloorType">
                                @{
                                    var check = "";
                                }
                                @if (floorItem != null)
                                {
                                    foreach (var item in floorItem)
                                    {
                                        if (item.SysNo.ToString().Equals(Model.FloorType))
                                        {
                                            check = "selected='selected'";
                                        }
                                        else
                                        {
                                            check = "";
                                        }
                                    <option @check value="@item.SysNo">@item.FloorTypeName</option>
                                    }
                                }
                            </select>
  • 相关阅读:
    Luogu 三国游戏
    牛客练习赛60E
    cf1321E
    cf988D
    cf1089F
    cf1055C
    cf997B
    cf1033D
    cf1062D
    cf1081E
  • 原文地址:https://www.cnblogs.com/shy1766IT/p/13475209.html
Copyright © 2020-2023  润新知