我想通過單擊鏈接按鈕來檢索標籤字段的值。它只能在onclick事件中被觸發。我已經嘗試過,但它是給予空值。在點擊鏈接按鈕時獲取gridview標籤字段
protected void verifycount_Click(object sender, EventArgs e)
{
GridViewRow link = ((LinkButton)sender).NamingContainer as GridViewRow;
Label qrcode = (Label)link.FindControl("lblqrcode");
string result=qrcode.text;
}
請幫忙做解決這個
這應該有效。什麼是'null'? –
它正在返回空值 –