protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "upd")
        {
            string id = e.CommandArgument.ToString();
            TextBox hh = (TextBox)e.Item.FindControl("num");     
            string ss = hh.Text;
            new AcomLb.BLL.ShProduct().updateProduct(id, hh.Text);
            bind();
           
        }
    }我代码是这样写的 但是每次取到的值都是他本身的文本框的值 而不是我修改过的
(做这个是修改下数量 但是取值的时候取到的是他的原来的值 而不是我修改后的文本框的值)

解决方案 »

  1.   

    if (!IsPostBack)
    {
    绑定Repeater1数据
    }
      

  2.   

    page_load事件里repeater绑定事件放在if(!ispostback)里
      

  3.   


    楼上的意思是  绑定是否写在了 (!IsPostBack)里面! 
      

  4.   

    你可以循环遍历一下Repeater1,
    例如不repeater里是label,ID=upd,可这样写
    for(int i=0;i<Repeater1.Items.count;i++)
    {
    label lb=(label)Repeater1.Items[i].FindControl("upd");
    TextBox hh = (TextBox)Repeater1.Items[i].FindControl("num"); 
    hh.text=lb.text;
    }
      

  5.   

    你这取文本框的值是取哪行的啊?
    CommandArgument这个里面写的什么?
    CommandArgument='<%# Container.ItemIndex %>'是这个?