Improved drop-down list date selection control

xiaoxiao2021-03-06  40

YearMonthDayDownDropList.ascx: <% @ Control Language = "c #" AutoEventWireup = "false" Codebehind = "YearMonthDayDownDropList.ascx.cs" Inherits = "Wzg.YearMonthDayDownDropList" TargetSchema = "http://schemas.microsoft.com/intellisense/ie5 "%>

year
month
Japanese YearMonthDayDownDropList.ascx.cs: namespace Wzg {using System; using System.Data; using System.Drawing; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls;

///

/// YearMontHDayDowndroplist's summary description. /// public class YearMonthDayDownDropList: System.Web.UI.UserControl {// date selected as: 20021225 public string YearMonthDay {get {return Request.Form [YearName] "-" Request.Form [MonthName] "-" Request.Form [DayName];} set {InitializeYearMonthDay = value;}} protected string InitializeYearMonthDay = ""; // initialize date protected int ServerYear; // currently selected server in protected int ServerMonth; / / server current month protected int ServerNowYear; // server is currently in protected int ServerDay; // server present day protected int ServerMonthDays; // number of days of the current month protected string JavascriptFunName; // this user control function name given protected string YearName; // This User Control's Name Protected String MonthName; / / This User Control's Name Protected String DayName; // This User Control's Name of the day control

private void Page_Load (object sender, System.EventArgs e) {// Put user code to initialize the page here string id = this.UniqueID; (! this.Page.IsClientScriptBlockRegistered (id)) if {JavascriptFunName = "chanday" id "()"; YearName = "year" id; MonthName = "month" id; DayName = "day" id; string scriptString = "