!
谁能解释下这段代码
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string PlacePK = Request["PlacePK"].ToString();
LinkButton linkbutton = (LinkButton)e.Row.Cells[3].FindControl("lBtnSelect");
linkbutton.CommandArgument = e.Row.RowIndex.ToString();
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "select")
{
string PlacePK = Request["PlacePK"].ToString();
string PlaceName = GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text.ToString();
string PlaceID = GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[2].Text.ToString();
new _PlacRCTableAdapters.PlaceTableAdapter().UpdatePlaceByKey(PlaceName, PlaceID, new Guid(PlacePK));
string sScript = "<script language=\"javascript\"> window.parent.close();</script>";
ClientScript.RegisterClientScriptBlock(GetType(), "Startup", sScript);
}
}