我想通过单击链接按钮来检索标签字段的值。它只能在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'? –
它正在返回空值 –