How to get values from template fields in GridView?

前端 未结 5 708
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 06:56

This is my markup of GridView.


    
        
            

        
5条回答
  •  再見小時候
    2021-01-05 07:23

     protected void Button1_Click(object sender, EventArgs e)
        {
            int i = 0;
            for (i = 0; i <= GvSchedule.Rows.Count - 1; i++)
            {
                if (((CheckBox)GvSchedule.Rows[i].FindControl("ChkIsService")).Checked)
                {
                    string catName = ((Label)GvSchedule.Rows[i].FindControl("lblCatName")).Text;
                    var subCatName = ((Label)GvSchedule.Rows[i].FindControl("lblSubCatName")).Text;
                }
            }
         }
    

提交回复
热议问题