zoukankan      html  css  js  c++  java
  • GridView,DataList,Repeater,DetailsView的遍历行代码

    foreach (DataListItem dli in DataList1.Items)
            {

                string id = DataList1.DataKeys[dli.ItemIndex].ToString();
                Response.Write("<script>alert('" + id + "')</script>");

            }
            foreach (DetailsViewRow dvr in DetailsView1.Rows)
            {

                string id = DetailsView1.DataKeys[dvr.RowIndex].Value.ToString();
                // string s = dvr.Cells[0].Text;
                Response.Write("<script>alert('" + id + "')</script>");

            }
            foreach (RepeaterItem ri in Repeater1.Items)
            {

                string id = Repeater1.DataKeys[ri.ItemIndex.ToString();
                Response.Write("<script>alert('" + id + "')</script>");

            }
            foreach (GridViewRow drv in GridView1.Rows)
            {
                string id = GridView1.DataKeys[drv.RowIndex].Value.ToString();
                // string s = drv.Cells[0].Text;
                Response.Write("<script>alert('" + id + "')</script>");
            }

  • 相关阅读:
    pandas中的时间序列基础
    Python中的进程
    Pandas透视表和交叉表
    Pandas分组级运算和转换
    Python中的线程详解
    Pandas聚合
    Python面试题整理
    Pandas分组
    暑假集训 || 动态规划
    DFS || HDU 2181
  • 原文地址:https://www.cnblogs.com/lds85930/p/1527959.html
Copyright © 2011-2022 走看看