zoukankan      html  css  js  c++  java
  • Repeater嵌套

    我们自己观察 这是由两个重复项组成的 重复项包含重复项 而重复项的数据源是由订单号决定 即父Repeater的某数据源字段

    protected void Repeater1_ItemDataBound1(object sender, RepeaterItemEventArgs e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
    Repeater rep = e.Item.FindControl("Repeater2") as Repeater;//找到里层的repeater对象
    Student student = e.Item.DataItem as Student;
    int StudentNo = Convert.ToInt32(student.StudentNo); //获取填充子类的id
    rep.DataSource = StudentManager.GetAddressByStudentNo(StudentNo);
    rep.DataBind();
    }
    }
    如果使用DateSet数据源的时候 要获取StudentNo这种主键 可以通过DataRowitem

  • 相关阅读:
    python redis
    Celery
    RabbitMQ
    python的文件锁操作
    cloud-init alibaba
    cloud-init tencent
    关于 python 的类
    jnija2模板渲染
    python multiprocessing
    学习html5的WebSocket连接
  • 原文地址:https://www.cnblogs.com/ZaraNet/p/9433446.html
Copyright © 2011-2022 走看看