January 15, 2012

Enum For Months .Net


#region Calender Constantspublic enum CalMonths{
January = 1,
Februray,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
}#endregion



public void BindDropdownlist()foreach (int value in Enum.GetValues(typeof (CalMonths)))new ListItem(Enum.GetName(typeof(CalMonths), value), value.ToString()));Convert.ToString(DateTime.Now.Month);
{

{
ddlMonth.Items.Add(
}
ddlMonth.DataBind();
ddlMonth.SelectedItem.Value =
GetYear();
}

No comments:

Post a Comment