protected void AddRegionButton_Click(object sender, EventArgs e) { try { bool confirmation = false; PRMS controller = new PRMS(); confirmation = controller.AddRegion(Region.Text); if (confirmation) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Region was added successfully.')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Region was not added.')", true); } Region.Text = ""; } catch (Exception) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with adding a region. Please contact customer support for assistance if this issue persists.’)", true); throw; } }