Assuming this markup:
<asp:DropDownList ID="cboMonth" runat="server"
DataTextField="text"
DataValueField="value" >
</asp:DropDownList>
Then this code should work quite well:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadCombo();
}
}
void LoadCombo()
{
DateTime Today = DateTime.Now;
DateTime dtStart = new DateTime(Today.Year, Today.Month, 1);
for (int i = 1;i <= 12;i++)
{
ListItem OneMonth = new ListItem();
OneMonth.Text = dtStart.ToString("MMM - yyyy");
cboMonth.Items.Add(OneMonth);
dtStart = dtStart.AddMonths(-1);
}
}
And the result is this: