title: DropDownList selected value on a razor view page
body: <p>I have the following DropDownList on a View Layout page that displays languages from an SQL database.  I want the selected item of the dropdownlist to be the page current culture (originalCulture). How can I accomplish that? </p>
  
  <p>For example if the page current culture (originalCulture="en") is equal to (item.language_UI="en") then the DDL selected item should be English (item.language). I know that it's easy but I'm not familiar with Razor codes. Can someone help?</p>
  
  <pre><code>@{
  var db = Database.Open("DefaultConnection");
  var listLanguage = "SELECT language, language_UI FROM Languages";
  var originalCulture = Convert.ToString(System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
  
  List&lt;SelectListItem&gt; languagedropdownlistdata = new List&lt;SelectListItem&gt;();
  bool isSelected = false;
  foreach (var item in db.Query(listLanguage))
  {
      languagedropdownlistdata.Add(new SelectListItem
      {
          Text = item.language,
          Value = item.language_UI,
          Selected = isSelected
      });
  }
  
  }
  </code></pre>
  
  <p>And here is the DropDownList on the content page:</p>
  
  <pre><code>@Html.DropDownList("lang", languagedropdownlistdata
  &lt;input type="submit" value="Select" /&gt;
  </code></pre>