protected void AddNewContactButton_OnClick(object sender, EventArgs e) { var newContact = new ContactInformation { FirstName = firstNameTxt.Value, LastName = lastNameTxt.Value, Address = AddressTxt.Value, EmailAddress = emailAddressTxt.Value, PhoneNumber = phoneNumberTxt.Value, IsActive = statusChkBox.Checked }; var isAdded = _contactInformationService.AddNewContact(newContact); if (isAdded) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Contact added successfully.');", true); Response.Redirect("~/ContactInformationPage.aspx", false); Context.ApplicationInstance.CompleteRequest(); } else { //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Some Error accured');", true); } }