c# check if textbox is empty or null code example Example: how to check if textbox is empty in c# string.IsNullOrWhiteSpace(textBox.Text); // returns boolean