row.Cells[4].Text returns nothing in GridView1_SelectedIndexChanged?

后端 未结 3 1220
难免孤独
难免孤独 2021-01-22 02:05

I have a GridView in my page :



        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-22 02:26

    //this will give you control over the textbox object
    var field = (TextBox)(GridView1.Rows[e.RowIndex].FindControl("your_control_ID"));
    //and here you can access the text
    string temp = field.Text;
    

提交回复
热议问题