protected void btnSave_Click(object sender, EventArgs e) { try { switch (RowID) { case 0: classProvider.AddClass( txtCode.Text, txtName.Text, chkIsActive.Checked, chkIsPaid.Checked); break; default: classProvider.UpdateClass( RowID, txtCode.Text, txtName.Text, chkIsActive.Checked, chkIsPaid.Checked); break; } Refresh(); } catch (Exception ex) { mvwForm.ActiveViewIndex = 0; WebFormHelper.SetLabelTextWithCssClass(lblMessage, ex.Message, LabelStyleNames.ErrorMessage); } }