title: Getting value to stay selected after post back for a drop down list
body: <p>I have code behind code in my page load that sets a drop down lists text and values.  WHen ever I select a value, it reloads the page because i have auto post back on.  I need the value to stay selected even after post back.  How would I go about doing this?  Below is my code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      List&lt;string&gt; list = new List&lt;string&gt;
        { "Month", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
  
      DropDownListMonth.DataSource = list;
      DropDownListMonth.DataBind();
      DropDownListMonth.SelectedIndex = 0;
  
      foreach (ListItem item in DropDownListMonth.Items)
      {
          int i = 0;
          string month = Convert.ToString(i);
          item.Value = month;
          i = Convert.ToInt32(month);
          i++;
      }   
  }
  </code></pre>