El gregoriano del mundo (calendario solar) ahora tiene un proceso de evolución a largo plazo. Veamos primero, el número de días por mes para el calendario gregoriano se fija: "El frente de siete es grande y los ocho después de los ocho".也就是说 , 一、三、五、七、八、十、腊月(十二月)是 31 天 , 四、六、九、十一月是 30 天 , 只有二月 , 平年 28 天 , 闰年 29 天Esencia
Copiar código del código de la siguiente manera:
< %@Page lenguaje = "c#" autoeEventWireUp = "true" codeBeHind = "webform1.aspx.cs" heredes = "WebApplication1.webform1" %>
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<head runat = "servidor">
<title> </title>
</ablo>
<Body>
<encontrado id = "form1" runat = "servidor">
<div>
<select name = yyyy id = "yyyy" onchange = "yyyymm (this.value)">
<opción valor = ""> Seleccione el año </ppection>
</select>
<select name = mm id = "mm" onchange = "mmdd (this.value)" >>
<opción valor = ""> Seleccione Moon </ppection>
</select>
<Seleccionar nombre = dd id = "dd">
<opción valor = ""> Seleccione Día </opción>
</select>
</div>
<ASP: Hiddenfield ID = "HfValue" Runat = "Server" />
<ASP: Button ID = "BTNSAVE" Runat = "Server" Text = "Save" onClick = "btnsave_click" />
</form>
</body>
</html>
<script language = "javaScript">
<!-
función getValue () {
var año = document.getElementById ("yyyy").
varmedh = document.getElementById ("mm").
var day = document.getElementById ("dd").
document.getElementById ("HfValue").
}
window.onload = function () {
Stryyyy = document.form1.yyyy.outerhtml;
strmm = document.form1.mm.outerhtml;
strdd = document.form1.dd.outerhtml;
Monhead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Damos el contenido del año del año.
var y y = nueva fecha ().
var str = stryyyyy.substring (0, stryyyyyyyyyyy -longitud -9);
para (var i = (y -80); i <(y+2); i ++) // Este año prevalece, los primeros 30 años, los próximos 30 años
{{
str + = "<option value = '" + i + "'>" + i + "año" + "</opción>/r/n";
}
document.form1.yyyy.outerhtml = str + "</select>" ";
// El cuadro de caída de FUyue
var str = strmm.substring (0, strmm.length -9);
para (var i = 1; i <13; i ++) {
str + = "<option value = '" + i + "'>" + i + "mes" + "</opción>/r/n";
}
document.form1.mm.outerhtml = str + "</select>" ";
document.form1.yyyy.value = y;
document.form1.mm.value = new Date ().
var n = Monhead [nueva fecha ().
if (new Date (). getMonth () == 1 && ispinyear (aaa yyyyvalue) n ++;
Writeay (n);
document.form1.dd.value = new Date ().
}
Función yyyymm (str) // La fecha cambia cuando cambia el año (juzga principalmente el año del ping)
{{
var mmValue = document.form1.mm.option
if (mmValue == "") {{
Dd.outerhtml = strdd;
Devolver;
}
var n = Monhead [mmValue - 1];
if (mmValue == 2 && ispinyear (str)) n ++;
Writeday (N)
}
Función mmdd (str) // enlace de fecha de cambio mensual
{{
VaryyyValue = document.form1.yyyy.options [document.form1.yyyy.selectedEx].
if (str == "") {
Dd.outerhtml = strdd;
Devolver;
}
var n = Monhead [str -1];
if (str == 2 && ispinyear (yyyyvalue) n ++;
Writeday (N)
}
Function writeday (n) // El cuadro de caída de la fecha de la fecha de escritura
{{
var s = strdd.substring (0, strdd.length -9);
para (var i = 1; i <(n + 1); i ++) s + = "<opción valor = '" + i + "'>" + i + "día" +
"</opción>/r/n";
document.form1.dd.outerhtml = s + "</select>" ";
}
Función ispinyear (año) // juzgar si debe aplanar el año
{{
Retorno (0 == año % 4 && (año % 100! = 0 || año % 400 == 0))
}
//->
</script>
.aspx.cs
Copiar código del código de la siguiente manera:
usando el sistema;
usando System.Collections.gneric;
usando System.Linq;
usando System.web;
usando System.web.ui;
usando System.Web.UI.WebControls;
espacio para la aplicación del espacio de nombres1
{{
CLASE PUBLIC parcial WebForm1: System.web.ui.Page
{{
Protegido void page_load (remitente de objeto, EventArgs e)
{{
btnsave.attributes.add ("onClick", "getValue ()");
}
Nulo protegido btnsave_click (remitente de objeto, eventArgs e)
{{
Respuesta.write (hfValue.Value);
}
}
}