here you can bind threee dates , today date and tomrrow date, and day after tomorrow dates to drop down list.
here we have to use namespace usingSystem.Globalization;
.aspx page code :
.cs page code
here we have to use namespace usingSystem.Globalization;
.aspx page code :
<table width="300" border="0" cellspacing="1" cellpadding="7">
<tr>
<td>
<asp:DropDownList ID="DdlDATE"runat="server"Height="23px"Width="233px"AutoPostBack="True">
<asp:ListItem Selected="True"Value="0">--Select Date--</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
.cs page code
protected void Page_Load(objectsender, EventArgs e)
{
if(!IsPostBack)
{
ListItem lt = new ListItem();
lt.Text = "--Select Date--";
lt.Value = "0";
DdlDATE.Items.Add(lt);
StringsDate = DateTime.UtcNow.ToString();
DateTimedatevalue = (Convert.ToDateTime(sDate.ToString()));
stringpattern = CultureInfo.CurrentCulture.DateTimeFormat.MonthDayPattern;
pattern = pattern.Replace("MMMM", "MMM");
stringformatted = "Today, " + datevalue.ToString(pattern);
stringformatted1 = "Tomorrow, " + datevalue.AddDays(1).ToString(pattern);
stringformatted2 = datevalue.AddDays(2).ToString(pattern);
DdlDATE.Items.Add(formatted);
DdlDATE.Items.Add(formatted1);
DdlDATE.Items.Add(formatted2);
}
}