更改日历服务器控制月份和年份

时间:2014-02-14 03:41:47

标签: c# asp.net calendar code-behind servercontrol

我正在尝试将日历服务器控件(在visual studio中)设置为用户使用下拉列表选择月份和一年的自定义月份和年份。我有它,以便日历不会出现,直到从下拉列表中选择月份和年份。我不知道现在要去哪里,以便当日历出现时,它被设置为所选的月份和年份,允许用户一旦出现就从日历中选择他们出生的那天。我正在使用C#代替我的代码。这是我的页面代码背后的代码:

  protected void DropDownListYear_SelectedIndexChanged(object sender, EventArgs e)
  {
    if (DropDownListMonth.SelectedIndex != 0)
    {
      CalendarBday.Visible = true;

      CalendarBday.SelectMonthText = DropDownListMonth.Text;
     }
   }
   protected void DropDownListMonth_SelectedIndexChanged(object sender, EventArgs e)
   {
     if (DropDownListYear.SelectedIndex != 0)
     {
       CalendarBday.Visible = true;
     }
    }

0 个答案:

没有答案