title: Switch Case in Razor based on parameters
body: <p>I am implementing tabbed view in mvc4. So i implemented partial view which in turn called in every view for tabbed structure. The below code set active tab based on the parameter passed from the view.</p>
  
  <pre><code>&lt;ul class="nav nav-tabs"&gt;
  @{ var UserFocus = ""; var CardFocus = ""; var CarrierFocus = ""; }
  @{
  switch(ViewData["ActiveMenu"].ToString())
  {
      case "User":
          UserFocus = "active";
          break;
      case "Card":
          CardFocus = "active";
          break;
      case "Carrier":
          CarrierFocus = "active";
          break;   
  }
  }
     &lt;li class="@UserFocus"&gt;User view link&lt;/li&gt;
     &lt;li class="@CardFocus"&gt;card view link&lt;/li&gt;
     &lt;li class="@CarrierFocus"&gt;Carrier view link&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>And in every view it will called like this based on the view</p>
  
  <pre><code>@Html.Partial("_AdminSettings", new ViewDataDictionary {{ "ActiveMenu", "User" }} )
  </code></pre>
  
  <p>This is working fine. </p>
  
  <ol>
  <li>I am sure whether the implementation is a standard practice ?</li>
  <li>Any other easy way for this implementation ?</li>
  </ol>