把这个id副给一个隐藏控件
然后用request[“id”]

解决方案 »

  1.   

    private int id;//--------------private void Page_Load(object sender, System.EventArgs e)
    {
       if (!IsPostBack) 
       {
        
           id = System.Convert.ToInt32(dr["id"]);
    ....
       }
    }
    private void Button1_Click(object sender, System.EventArgs e)
    {
    ....
        string myInsertQuery = "update test set col1='"+TextBox1.Text+"', col2='"+TextBox_2.Text+"' where id = " + id;
    ....
    }
      

  2.   

    看你是在 !IsPostBack中作的还是用Session吧。 
       {
      

  3.   

    那就把查出某用户的这条记录,得到主键ID的值存到cookie,或session,用完之后清空,就不会怕重复的值