Evaluate Multiple In One Statement
How would one evaluate 3 fields to determine if they are blank? I am creating an intranet page for my company, and the login screen requires the users 1st name, users last name and their company id. What I am needing to do is if all 3 fields are blank, highlight (and by highlight I mean backcolor) all 3 textboxes red (txtFirstName, txtLastName, txtComID), if 1st Name is entered BUT the other 2 fields remain null, then only highlight txtLastName and txtComID Red. What is the way to evaluate in C# to check all 3 fields and only highlight RED the field's that are null?

VulpesRank #55 · 29.2K reputationPosted Jan 16, 2013, 12:06 PM EST
richard smithRank #8,268 · 225 reputationPosted Jan 16, 2013, 12:42 PM EST
One other question...how could I trim out an extra space in the fields? For example, let's say the user input a space after entering there ComID, instead of causing that to fail the validation check, is there a way to programatically remove the blank space at the end?
VulpesRank #55 · 29.2K reputationPosted Jan 16, 2013, 12:45 PM EST
txtFirstName.Text = txtFirstName.Text.Trim();
txtLastName.Text = txtLastName.Text.Trim();
txtComID.Text = txtComID.Text.Trim();
Phani Bhushan21 reputationPosted Jan 16, 2013, 7:29 PM EST