惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

博客园 - 大牛博客

广东早茶的悠闲时光 用户中心 - 博客园 GridView数据绑定控件和ObjectDataSource数据源控件实现排序功能 - 大牛博客 - 博客园 asp.net 常用字符串过滤方法 非常实用的Asp.net常用的51个代码 - 大牛博客 - 博客园 JS 中面向对象的5钟写法 GridView的RowCommand事件中取得行索引 - 大牛博客 - 博客园 .netframework3.5 中TimeZoneInfo 类的使用 ASP.NET 2.0上传图片生成缩略图类 合理选择贪婪模式与非贪婪模式 - 大牛博客 - 博客园 揭开正则表达式的神秘面纱 asp.net下载文件 - 大牛博客 - 博客园 C#数据结构之双向链表 C#数据结构之队列 ASP.NET四种页面导航方式之比较与选择 asp.net页面事件执行顺序 中英文字符串截取方法 - 大牛博客 - 博客园 ASP.NET纯数字验证码 SQL 2005 ROW_NUMBER() 语句分页 | SQL效率最高的分页查询数据
GridView,DataList,Repeater,DetailsView的遍历行代码 - 大牛...
大牛博客 · 2009-07-21 · via 博客园 - 大牛博客

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>");
        }