日期:2014-05-18 浏览次数:20495 次
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string name = e.CommandName;
int index = Convert.ToInt32(e.CommandArgument);
string a = GridView1.Rows[index].Cells[1].Text;
if (name == "open")
{
Response.Redirect("a.aspx?id="+a);
}
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button bt = (Button)e.Row.Cells[0].FindControl("Button2");
bt.CommandArgument = e.Row.RowIndex.ToString();
}
}