title: Check asp.net textbox value against multiple if conditions
body: <p>I have my website built in ASP.NET 2.0 and C#. I have textbox called tbCode where a user enters a code. I am trying to check that entered value against multiple values in the code behind on a button click. </p>
  
  <p>This is my mark up so far.</p>
  
  <pre><code> protected void btUpdate_Click(object sender, EventArgs e)
  {
  
  
      if ((this.tbcode.Text.Trim().ToUpper() != "AB12") ||(this.tbcode.Text.Trim().ToUpper() != "DE14") || (this.tbcode.Text.Trim().ToUpper() != "XW16"))
      {
          lbmessage.Text = "Invalid Promo code. Please enter again";
      }
      else if ((this.tbcode.Text.Trim().ToUpper() == "AB12") || (this.tbcode.Text.Trim().ToUpper() == "DE14") || (this.tbcode.Text.Trim().ToUpper() == "XW16"))
      {
          Order.Shipping.Cost = 0;
          this.lShipping.Text = Order.Shipping.Cost.ToString("c");
          this.lSubtotal.Text = Order.Subtotal.ToString("c");
          this.lTotal.Text = Order.TotalCost.ToString("c");
          Order.PomoCode = this.tbcode.Text.Trim().ToUpper();
          lbmessage.Text = "Promo Code Applied.";
      }
      else
      {
          this.lShipping.Text = Order.Shipping.Cost.ToString("c");
          this.lSubtotal.Text = Order.Subtotal.ToString("c");
          this.lTotal.Text = Order.TotalCost.ToString("c");
  
      }
  
  }
  </code></pre>
  
  <p>when i hit the button its always saying invalid code. not sure where am i making the mistake. It works perfectly if I am checking against just one value rather than the 3.</p>
  
  <p>Thanks and appreciate it</p>