runat="server" OnClick="LinkButton1_Click">LinkButton
--------------------------
protected void LinkButton1_Click(object sender, EventArgs e)
{
LinkButton lkbtn = sender as LinkButton;
string strsql = "SELECT * FROM Tablename where 字段名='" + lkbtn.CommandArgument.ToString() + "'";//查询的列名为前台模版列LinkButton CommandArgument属性绑定的字段;
DataTable tbl = new DataTable();
///根据Sql语句获取Datatable
DataList2.DataSource = tbl;
DataList2.DataBind();
}
用DataList的事件也可以
把datalist2的绑定写在datalist1_SelectedIndexChanged(object sender, EventArgs e)中
传个你