YearMonthDayDownDropList.ascx: <% @ Control Language = "c #" AutoEventWireup = "false" Codebehind = "YearMonthDayDownDropList.ascx.cs" Inherits = "Wzg.YearMonthDayDownDropList" TargetSchema = "http://schemas.microsoft.com/intellisense/ie5 "%>
Style = "Width: 53px; Height: 61px" Name = <% = yearname% >> <% FillOptions (2000, Servernowyear, Serveryear);%> select>
61px "οnclick = <% = javascriptfunname%> Name = <% = monthname% >> <% FillOptions (1, 12, servermonth);%> select>
61px "Name = <% = dayname% >> <% FillOptions (1, ServerMontHDays, ServerDay);%> select> td>
/// /// YearMontHDayDowndroplist's summary description. /// summary> 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 = "