protected void GridViewTherapists_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AddEmergencyTherapist")) { string patientNRIC = ViewState["GridViewAccountsSelectedNRIC"].ToString(); try { string therapistNRIC = e.CommandArgument.ToString(); accountBLL.AddEmergencyTherapist(patientNRIC, therapistNRIC); string therapistTerm = TextboxSearchTherapist.Text.Trim().ToLower(); Bind_GridViewTherapists(patientNRIC, therapistTerm); Bind_GridViewTherapists2(patientNRIC); UpdatePanelPatient.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['success']('Emergency Therapist, " + therapistNRIC + ", has been assigned to " + patientNRIC + ".');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error occured when assigning emergency Therapist to " + patientNRIC + ".');", true); } } }