title: DropDownList selected value not getting set
body: <p>I am using two dropdowns for Month and Year selection, I have made a user control and I am having this control inside a repeater control.
  I have to show the selected values from database in them. for eg if in database it is 5/2014 then it should show May in Month drop down and 2014 in year drop down.
  I am doing this in RowDatabound event, but its not getting selected.
  This is how I am doing</p>
  
  <pre><code>var txtFrom = e.Item.FindControl("txfrom") as TextBox;//I will have values in mm/yyy
  var datefrom = e.Item.FindControl("ddempfrom") as CutomControls.MonthYearPicker;
  var monthfrom = datefrom1.FindControl("ddmonth") as DropDownList;
  var yearfrom = datefrom1.FindControl("ddyear") as DropDownList;
  
  monthfrom.SelectedValue=txtFrom.Text.Split('/')[0];
  yearfrom .SelectedValue=txtFrom.Text.Split('/')[1];
  </code></pre>
  
  <p>and this is how I am making dropdownlists in UserControl</p>
  
  <pre><code>private void LoadMonthYear()
  {
      for (int i = 1; i &lt;= 12; i++)
      {
          DateTime date = new DateTime(1900, i, 1);
          ddmonth.Items.Add(new System.Web.UI.WebControls.ListItem(date.ToString("MMMM"), i.ToString()));
      }
  
      var currentYear = DateTime.Now;
      for (int i = 1900; i &lt;= Convert.ToInt32(currentYear.ToString("yyyy")); i++)
      {
          ddyear.Items.Add(new System.Web.UI.WebControls.ListItem(i.ToString(), i.ToString()));
      }   
  }
  
  protected void Page_Load(object sender, EventArgs e)
  {
      if (!Page.IsPostBack)
      LoadMonthYear();
  }
  </code></pre>
  
  <p>I tried debugging and when break point comes to the line where I am setting selected value, after going to next line,the selectedvalue appears to be blank</p>
  
  <p>My DropDown Lists</p>
  
  <pre><code>&lt;asp:DropDownList ID="ddmonth" runat="server"&gt;
  &lt;/asp:DropDownList&gt;
  -
  &lt;asp:DropDownList ID="ddyear" runat="server"&gt;
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>Update: I noticed that <code>RowDataBound</code> is hitting first then <code>Page_Load</code> of Usercontrol is hiting</p>