Question: I have this conditions 

```
if (txtBoxFatherHusbandName.Text != "" || txtBoxName.Text != "" || txtBoxNICNo.Text != "")
{
    ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields");    
    txtBoxFatherHusbandName.Focus();    
    return;
}

```

all three textboxes are empty with no text in it but still the conditions is getting executed. why ?

Answer: 
You have to use [`String.IsNullOrWhiteSpace()`](https://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace%28v=vs.110%29.aspx) to check them here, because user may press spaces in that case there can be propblems, so you should be writing if like following to tackle with empty textboxes:

```
if (!String.IsNullOrWhiteSpace(txtBoxFatherHusbandName.Text) || .......)

```
```
if (!string.IsNullOrWhiteSpace(txtBoxFatherHusbandName.Text) || !string.IsNullOrWhiteSpace(txtBoxName.Text) || !string.IsNullOrWhiteSpace(txtBoxNICNo.Text))
    {
        ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields");

        txtBoxFatherHusbandName.Focus();

        return;
    }

```