< input id = " selDate " type = " hidden " value = " 1980/1/1 " runat = " server " > < select id = " selYear " onchange = " chanday() " > < script > for (var i = 1900 ;i < 2006 ;i ++ ) ... {if(i == 1980)document.write("<option value='" + i + "' selected>" + i + "</option>");elsedocument.write("<option value='" + i + "'>" + i + "</option>");} </ script > </ select > < select id = " selMonth " onchange = " chanday() " > < script > for (var i = 1 ;i <= 12 ;i ++ ) ... {document.write("<option value='" + i + "'>" + i + "</option>");} </ script > </ select > < select id = " selDay " onchange = " chanday() " > < script > for (var i = 1 ;i < 31 ;i ++ ) ... {document.write("<option value='" + i + "'>" + i + "</option>");} </ script > </ select > < asp:Button ID = " Button1 " Style = " z-index: 101; left: 168px; position: absolute; top: 192px " runat = " server " Text = " Button " OnClick = " Button1_Click " ></ asp:Button > </ form > < script > function chanday() ... {var days=31;var currentyear;if(document.getElementById('selMonth').value==04||document.getElementById('selMonth').value==06||document.getElementById('selMonth').value==09||document.getElementById('selMonth').value==11)days=30;else if(document.getElementById('selMonth').value==02)...{Nowyear=document.getElementById('selYear').value ;if((Nowyear%4==0 &&Nowyear%100!=0) || Nowyear%400==0)days=29;elsedays=28;}flen=document.getElementById('selDay').length;if(flen > days)document.getElementById('selDay').selectedIndex = days - 1;document.getElementById('selDay').length =days;for(i=flen+1;i<=days;i++)...{document.getElementById('selDay').options(i-1).text=i;document.getElementById('selDay').options(i-1).value=i;}document.getElementById('selDate').value = document.getElementById('selYear').value + "/" + document.getElementById('selMonth').value + "/" + document.getElementById('selDay').value;} </ script > 在后台代码里面写入 protected void Button1_Click( object sender, EventArgs e) ... { DateTime dt = DateTime.Parse(Request.Form["selDate"]); Response.Write(dt.ToString()); } " />