protected void UpdateContact_OnClick(object sender, EventArgs e) { var updatedContactDetail = new ContactInformation { Id = Convert.ToInt32(Request.QueryString["Id"]), FirstName = firstNameTxt.Value, LastName = lastNameTxt.Value, Address = AddressTxt.Value, EmailAddress = emailAddressTxt.Value, PhoneNumber = phoneNumberTxt.Value, IsActive = statusChkBox.Checked }; var isUpdated = _contactInformationService.UpdateContactInformation(updatedContactDetail); if (isUpdated) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Contact updated successfully.');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('An Error Occured while updating.');", true); } Response.Redirect("~/ContactInformationPage.aspx", false); Context.ApplicationInstance.CompleteRequest(); }