I am familiar with validation controls in .Net when validating textboxes on my form but not how to do it with C#. I did some research, and I know the basics of validation, like making sure that a control is not null.
But how do you test for characters? I have a textbox ID field that can only be numeric. Nothing I have found from research has used anything like that; it is mostly IsNullOrEmpty.
How do you implement something like that to test for a numeric value in a string field?
if (string.IsNullOrEmpty(rTxtBoxFormatID.Text))
{
ValidationMessages.Add("Missing Product Number");
}
I solved this below, I needed to compare it to comobox.selectedindex in the if statement.
if (string.IsNullOrEmpty(cmboBoxStock.SelectedIndex.ToString()))
{
rLblStockIDError.Text = "Missing Stock Number";
}