title: ASP.NET MVC DropDownList Selected Changed Event
body: <p>When I select a TranCode from a dropdownlist generated from the database, how can it automatically set the assigned TabNo to active and display the Type in a label?</p>
  
  <p>I'm using bootstap and I'm not using the entity framework, just comment if you want to see all the code, thanks.</p>
  
  <p>Table:</p>
  
  <pre><code>TranCode-----TabNo-----Type
  100100-------1---------Cash
  100101-------1---------Card
  100102-------2---------Card
  100103-------3---------Cash
  100104-------1---------Cash
  100105-------3---------Card
  100106-------3---------Cash
  </code></pre>
  
  <p>Index.chtml</p>
  
  <pre><code>&lt;select class="form-control"&gt;
  @foreach (System.Data.DataRow dr in Model.Transactions.Rows)
  {
      &lt;option&gt;@dr["TranCode"].ToString()&lt;/option&gt;
  }
  &lt;/select&gt;
  
  &lt;label id="lblType" for="lblTypeValue"&gt;Type: &lt;/label&gt;
  &lt;label id="lblTypeValue"&gt;N/A&lt;/label&gt;
  
  &lt;div class="panel-heading"&gt;
      &lt;ul class="nav nav-tabs"&gt;
          &lt;li class="active"&gt;&lt;a href="#tab1default" data-toggle="tab"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tab2default" data-toggle="tab"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tab3default" data-toggle="tab"&gt;Tab 3&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>