title: How to check 2 Textboxes for data in VB .Net
body: <p>First, I want to Check the Textbox1 for some data and if it is empty, then do not display anything at all. But if there's some data in Textbox1, i now want to check Textbox 2 whether it is empty or not... If the textbox2 is empty then display only the text in the textbox1 but if the textbox2 has some data in it, then display "Textbox1 + Textbox2" data.</p>
  
  <p>Here's some code i've written, but i'm not successful to get the desired output.</p>
  
  <pre><code>Dim CheckText As String
      If (Not String.IsNullOrWhiteSpace(Textbox1.Text)) Then
      ElseIf (String.IsNullOrWhiteSpace(Textbox2.Text)) Then
          CheckText = String.Format("&lt;a href={0}{1}{0}&gt;{2} by {3}&lt;/a&gt;{4}{4}&lt;/div&gt;", qmQuotes, Link1.Text, Textbox.Text, xyz.Text, Environment.NewLine)
      Else
          CheckText = String.Format("&lt;a href={0}{1}{0}&gt;{2}: {4} by {3}&lt;/a&gt;{5}{5}&lt;/div&gt;", qmQuotes, Link1.Text, Textbox.Text, xyz.Text, abc.Text, Environment.NewLine)
      End If
  </code></pre>