标题:TextBox txt = (TextBox)this.DataList1.Items[?].FindControl("txtAQualif ...
只看楼主
恋雪怜冰
Rank: 1
来 自:苏州
等 级:新手上路
帖 子:84
专家分:2
注 册:2010-3-11
结帖率:100%
 问题点数:0 回复次数:2 
TextBox txt = (TextBox)this.DataList1.Items[?].FindControl("txtAQualificati
string ArtID = Request.QueryString["ArtID"].ToString();
               string jobTitle = this.txtName.Text;
               string times = this.txtTime.Text;
               string address = this.txtaddress.Text;
               if (ArtBus.updateA(jobTitle, times, address, ArtID) != null)
                {
                    for (int i = DataList1.Items.Count; i > this.DataList1.Items.Count; i--)
                    {
                        TextBox txt = (TextBox)this.DataList1.Items[DataList1.Items.Count].FindControl("txtAQualifications");
                        string AQualifications = txt.Text;
                        Label lb = (Label)this.DataList1.Items[DataList1.Items.Count].FindControl("lbID");
                        string AQualificationsID = lb.Text;
                           if(ArtBus.UpdateAQ(AQualificationsID,AQualifications) != null)
                           {
                               for (int j = DataList2.Items.Count; j > this.DataList2.Items.Count;j--)
                               {
                                   TextBox txt1 = (TextBox)this.DataList2.Items[DataList2.Items.Count].FindControl("txtAJobDuties");
                                   string AJobDuties = txt1.Text;
                                   Label lb1 = (Label)this.DataList2.Items[DataList2.Items.Count].FindControl("lbID1");
                                   string AJobDutiesID = lb1.Text;
                                   if (ArtBus.UpdateAJ(AJobDuties, AJobDutiesID) != null)
                                   {
                                     Response.Write("<script>alter('修改成功!');</script>");
                                   }
                               }
                            }  
                      }
                }

怎样获得datalist中的第几行?运行总是出错
望高手帮忙看下 谢谢!
搜索更多相关主题的帖子: TextBox txt FindControl 
2010-09-03 12:57
qingshuiliu
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:17
帖 子:323
专家分:1538
注 册:2009-12-28
得分:0 
从错误类型看:
一种是递归调用,一种可能是循环不结束
2010-09-03 19:55
恋雪怜冰
Rank: 1
来 自:苏州
等 级:新手上路
帖 子:84
专家分:2
注 册:2010-3-11
得分:0 
我已经解决了,是循环不结束。
2010-09-04 11:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-317615-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.823972 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved