控件效果如下:
从左到右:month,day,year
.cs文件初始化这三个下拉列表
复制代码 代码如下:
private void BindBirthDay(int day, int month, int year)
{
int dayNow = day;
int monNow = month;
int yearNow = year;
//binding Month
for (int i = 1; i <= 12; i++)
{
ddlBirMon.Items.Add(new ListItem(i.ToString(), i.ToString()));
}
ddlBirMon.Items[monNow - 1].Selected = true;
//binding Day
int daysOfMonth = DateTime.DaysInMonth(yearNow, monNow);
for (int i = 1; i <= daysOfMonth; i++)
{
ddlBirDay.Items.Add(new ListItem(i.ToString(), i.ToString()));
}
ddlBirDay.Items[dayNow - 1].Selected = true;
//binding Year
for (int i = 20; i > 0; i--)
{
ddlBirYear.Items.Add(new ListItem((yearNow - i).ToString(), (yearNow - i).ToString()));
}
for (int i = 0; i < 20; i++)
{
ddlBirYear.Items.Add(new ListItem((yearNow + i).ToString(), (yearNow + i).ToString()));
}
ddlBirYear.Items.FindByValue(yearNow.ToString()).Selected = true;
}
js代码如下(自己写的,不保证完全正确啊):
复制代码 代码如下:
function ChangeDay() {
var month = document.getElementById("<%=ddlBirMon.ClientID %>");
var year = document.getElementById("<%=ddlBirYear.ClientID %>");
var day = document.getElementById("<%=ddlBirDay.ClientID %>");
if (month.selectedIndex == 3 || month.selectedIndex == 5 || month.selectedIndex == 8 || month.selectedIndex == 10) {
if (day.length == 31) {
if (day.options[30].selected == true) {
day.options[29].selected = true;
}
day.remove(30);
}
}
else{
while (day.length < 31) {
day.add(new Option(day.length+1,day.length+1));
}
}
if (month.selectedIndex == 1) {
if (day.length > 28) {
if (day.selectedIndex == 28) {
day.options[27].selected = true;
}
while (day.length > 28) {
day.remove(day.length - 1);
}
}
var sy = year.options[year.selectedIndex].value;
if ((sy % 4 == 0 && sy % 100 != 0) || (sy % 400==0)) {
day.add(new Option("29", "29"));
}
}
}
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。