受保护的void GridViewStaff_RowCommand(对象发送者,GridViewCommandEventArgs e) { // int index = Convert.ToInt32(((sender as LinkButton).NamingContainer as GridViewRow).RowIndex); 整数索引= Convert.ToInt32(e.CommandArgument);
if (e.CommandName.Equals("editRecord"))
{
GridViewRow gvrow = GridViewStaff.Rows[index];
txtfirstNAme.Text = HttpUtility.HtmlDecode(gvrow.Cells[3].Text).ToString();
txtLastName.Text = HttpUtility.HtmlDecode(gvrow.Cells[7].Text);
txtCountry.Text = HttpUtility.HtmlDecode(gvrow.Cells[4].Text);
lblResult.Visible = false;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(@"<script type='text/javascript'>");
sb.Append("$('#editModal').modal('show');");
sb.Append(@"</script>");
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditModalScript", sb.ToString(), false);
}