protected void btnSave_Click(object sender, EventArgs e) { try { switch (RowID) { case 0: branchProvider.Add( txtCode.Text.ToUpper(), txtName.Text, txtAddress.Text, txtPhone.Text, txtEmail.Text, txtMerchantCode.Text, chkIsActive.Checked); break; default: branchProvider.Update( RowID, txtCode.Text.ToUpper(), txtName.Text, txtAddress.Text, txtPhone.Text, txtEmail.Text, txtMerchantCode.Text, chkIsActive.Checked); break; } Refresh(); } catch (Exception ex) { mvwForm.ActiveViewIndex = 0; WebFormHelper.SetLabelTextWithCssClass(lblMessage, ex.Message, LabelStyleNames.ErrorMessage); } }