2024年4月5日发(作者:)

runat="server" CausesValidation="false" OnClick="Test"

CommandName="" Text=' <%#Eval("name") %>' />

C# code

protected void Test(object sender, EventArgs e)

{

Button btn= (Button)sender;

int i= ((GridViewRow)Container).RowIndex;//获得行号

int j= 16(ys[i].Value);

}

//****声明一个变量

private int intRow=0;

//****构造一个自增变量函数

public int AutoRowNumber()

{

return intRow++;

}

//*****前台邦定,datagive模版列中邦定即可