怎样实现在DataGarid里的ButtonColumn写他的触发事件?
我有个DataGarid里面放置了一个ButtonColumn,想当点击ButtonColumn的时候,触发一段脚本,然后弹出一个新的页面出来,不知道怎么实现?
--------------------------------------------------
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
TextBox txtSiteId = new TextBox();
txtSiteId = (TextBox) e.Item.Cells[8].FindControl("txtSiteId_U");
TextBox txtSiteName = new TextBox();
txtSiteName = (TextBox) e.Item.Cells[8].FindControl("txtSiteName_U");
TextBox txtPartId = new TextBox();
txtPartId = (TextBox) e.Item.Cells[8].FindControl("txtPartId_U");
TextBox txtDistrictId = new TextBox();
txtDistrictId = (TextBox) e.Item.Cells[8].FindControl("txtDistrictId_U");
TextBox txtTownshipId = new TextBox();
txtTownshipId= (TextBox) e.Item.Cells[8].FindControl("txtTownshipId_U");
TextBox txtArea = new TextBox();
txtArea = (TextBox) e.Item.Cells[8].FindControl("txtArea_U");
TextBox txtAddress = new TextBox();
txtAddress= (TextBox) e.Item.Cells[8].FindControl("txtAddress_U");
TextBox txtOwner = new TextBox();
txtOwner = (TextBox) e.Item.Cells[8].FindControl("txtOwner_U");
string strSiteId = txtSiteId.Text.Trim();
string strSiteName= txtSiteName.Text.Trim();
string strPartId = txtPartId.Text.Trim();
string strDistrictId = txtDistrictId.Text.Trim();
string strTownshipId = txtTownshipId.Text.Trim();
string strArea = txtArea.Text.Trim();
string strAddress = txtAddress.Text.Trim();
string strOwner = txtOwner.Text.Trim();
e.Item.Cells[0].Attributes.Add("onclick","btnUpdate_OnClick('" + strSiteId + "','" + strSiteName + "','" + strPartId + "','" + strDistrictId + "','" + strTownshipId + "','" + strArea + "','" + strAddress + "','" + strOwner + "')");
}