title: How do I check if selected value of the ListBox is not selected in C#?
body: <p>This code will display the selected value from the listbox. E.g. if I sellect <strong>Item 1</strong> I will get the following output: <strong>You have selected Item 1</strong>.</p>
  
  <pre><code>Label1.Text = "You have selected " + DropDownList1.SelectedValue + "&lt;br /&gt;";
  </code></pre>
  
  <p>But if I don't select anything and click on Submit button, I will get: <strong>You have selected</strong></p>
  
  <p>What would I need to make it display <strong><em>"You have not selected anything. Please select at least 1 item."</em></strong></p>
  
  <p><em>UPDATE: I am using ASP.NET WebForms.</em></p>