//Birth date validation protected void txtBirthDate_TextChanged(object sender, EventArgs e) { if (!mmType.IsEmpty(this.txtBirthDate.Text)) this.txtBirthDate.Text = ValidDate(this.txtBirthDate.Text); else this.txtBirthDate.Text = null; } protected string ValidDate(string datevalue) { DateTime CheckDate; try { CheckDate = DateTime.Parse(datevalue); return CheckDate.ToShortDateString(); } catch { lblErrorMessage.Text = "Invalid date entered."; return null; } }Here's the code I tried in the business rules:
public string Validatebirthdate(DateTime birthdate) { string Msg = null; if (mmType.IsEmpty(birthdate)) { this.DataRow["birthdate"] = null; } return Msg; }Thanks for your help.