protected void userGR_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("detail")) { int index = Convert.ToInt32(e.CommandArgument); string id = userGR.DataKeys[index].Value.ToString(); int mailboxid = int.Parse(id); int accountid = int.Parse(accountID.Value); DBC.SQLStore SQL = new DBC.SQLStore(); DataTable detailTable = SQL.ExchangeUserinCompany(accountid, mailboxid); DetailsView1.DataSource = detailTable; DetailsView1.DataBind(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#currentdetail').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", sb.ToString(), false); } }