从一个表中读取数据到Repeater,Repeater中增加两列放入DropDownList,进行选择内容。然后所有行都处理好了后,把Repeater中的所有行一起insert 到数据库的另一个表中。怎么实现?谢谢啦。

解决方案 »

  1.   


      protected void Button1_Click(object sender, EventArgs e)
            {
                foreach (RepeaterItem item in this.Repeater1.Items)
                {
                    DropDownList dll = item.FindControl("ddl_Group") as DropDownList;
                    HiddenField hf = item.FindControl("HiddenField1") as HiddenField;
                    if (dll != null && hf != null)
                    {
                        string Group_ID = dll.SelectedValue == "-1" ? "" : dll.SelectedValue;
                        string User_ID = hf.Value;
                        PXCLASS_STUDENTInfo studentInfo = oStudent.Get(ClassID, User_ID);
                        studentInfo.GROUP_ID = Group_ID;
                        oStudent.Update(studentInfo);                }
                }
                oJavaScript.Alert("保存成功");
                this.MultiView1_ActiveViewChanged(sender, e);
            }
    不需要的可以删掉