zoukankan      html  css  js  c++  java
  • 后台方庄List razor 循环

     后台:

      //1.查询所有年卡类型
                    StringBuilder sqlStr = new StringBuilder();
                    sqlStr.Append(string.Format("  select  Id,TypeName  from tb_yearcard_cardtype where MerchantCode='{0}' ",this.Base_Code));
                    DataTable dt = Shove.Database.MySQL.Select(sqlStr.ToString());
                    List<YearcardCardType> y_List = new List<YearcardCardType>();


                    ViewBag.YearCarEditType = 1;//操作类别
                    ViewBag.yearCardCardType = y_List;//列表

    视图:

    头部引用     @using EquipmentPay.Areas.Web.Models;

            @foreach (YearcardCardType data in @ViewBag.yearCardCardType as List<YearcardCardType>)
                                        {    
                                            <option value='@data.Id'>@data.TypeName</option>
                                        }

  • 相关阅读:
    [LeetCode] Word Ladder II
    [LeetCode] Edit Distance
    [LeetCode] Merge Intervals
    内存分配与Segmentation fault
    结构体 指针 数组
    resolv.conf
    无法启动xwindow
    stopping NetworkManager daemon failed
    linux 挂载光盘:mount: you must specify the filesystem type
    修改主机hostname
  • 原文地址:https://www.cnblogs.com/j2ee-web-01/p/7207324.html
Copyright © 2011-2022 走看看