protected void Submit_Click(object sender, EventArgs e) { if (Page.IsValid) { ToDoItemData.AddItem(Description.Text, Category.SelectedValue); Description.Text = string.Empty; } }
protected void Submit_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(TODODescription.Text)) { ErrorMessage.Visible = false; ToDoItemData.AddItem(TODODescription.Text, int.Parse(TODOPriority.SelectedValue)); ResetForm(); } else { ErrorMessage.Visible = true; } }