GridView 与SqlDataSource或者DataSet绑定  
比如 一列 id 一列 name
现在需要双击的时候得到id 传到TextBox.Text 望给出代码(C#)  谢谢  急等

解决方案 »

  1.   

    TextBox txtBox;
    <script>
    </script>
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
    DataRow dr = (DataRow)e.Row.DataItem;
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
    e.Row.Attributes.Add("ondblclick", "JavaScript:document.getElementById('" txtBox.ClientID + "').value=" + dr["id"].ToString() );
    }
    }
      

  2.   

    不好意思 我表述有误
    是把选到id传到 另外一个页面(add.aspx)的TextBox