protected void btnSaveDailyNote_Click(Object sender, EventArgs e) { this.pnlDailyEditor.Visible = false; Calendar cal = (Calendar)this.plhDailyEditorCal.Controls[0]; DateTime d = cal.SelectedDate; loadDataset(); DataRow dailyRow = _dataset.Tables["dailynotes"].NewRow(); DataRow[] rowz = _dataset.Tables["dailynotes"].Select(String.Format("id_cal={0} AND notedate='{1}'", CurrentCalendarID, d.ToShortDateString())); if (rowz.Length > 0) { dailyRow = rowz[0]; } else { dailyRow["id_dailynote"] = getNextId("dailynotes", "id_dailynote"); dailyRow["id_cal"] = CurrentCalendarID; dailyRow["notedate"] = d; _dataset.Tables["dailynotes"].Rows.Add(dailyRow); } dailyRow["note"] = this.txtDailyNotes.Text; dataSave(); return; }
private void Page_Load(object sender, System.EventArgs e) { for (int month = 0; month < 2; month++) { TableCell tc = new TableCell(); tc.VerticalAlign = VerticalAlign.Top; System.Web.UI.WebControls.Calendar c = new System.Web.UI.WebControls.Calendar(); c.VisibleDate = DateTime.Today.AddMonths(month); c.DayRender += new DayRenderEventHandler(DateCal_DayRender); c.DayStyle.Width = Unit.Parse("30px"); c.DayStyle.Height = Unit.Parse("35px"); c.DayStyle.VerticalAlign = VerticalAlign.Top; c.DayStyle.CssClass = "BannerCalendarDay"; c.DayHeaderStyle.CssClass = "BannerCalendarDayHeader"; c.OtherMonthDayStyle.CssClass = "BannerCalendarOtherMonthDay"; c.CssClass = "BannerCalendar"; c.TitleStyle.CssClass = "BannerCalendarTitle"; c.CellPadding = 0; c.CellSpacing = 0; c.ShowNextPrevMonth = false; tc.Controls.Add(c); Row.Cells.Add(tc); } }
private Calendar getCal(Int32 nbMonthsToAdd) { Calendar cal = new Calendar(); cal.VisibleDate = new DateTime(_startYear, 1, 1).AddMonths(nbMonthsToAdd); cal.ShowNextPrevMonth = false; cal.SelectionMode = CalendarSelectionMode.Day; cal.OtherMonthDayStyle.ForeColor = System.Drawing.Color.White; cal.Font.Size = new FontUnit(8, UnitType.Point); cal.ShowGridLines = true; cal.DayStyle.ForeColor = System.Drawing.Color.Crimson; cal.WeekendDayStyle.ForeColor = System.Drawing.Color.BlueViolet; cal.WeekendDayStyle.Font.Bold = true; cal.WeekendDayStyle.Font.Italic = true; cal.DayHeaderStyle.BackColor = System.Drawing.Color.LightSteelBlue; cal.TitleStyle.CssClass = "calmois"; cal.SelectedDayStyle.CssClass = "selday"; cal.SelectedDayStyle.ForeColor = System.Drawing.Color.Black; cal.TitleFormat = TitleFormat.Month; cal.DayRender += new DayRenderEventHandler(cal_DayRender); cal.SelectionChanged += new EventHandler(cal_SelectionChanged); cal.DayNameFormat = DayNameFormat.Shortest; cal.DayHeaderStyle.CssClass = "calmois"; cal.BorderStyle = BorderStyle.Solid; cal.BorderColor = System.Drawing.Color.Gray; cal.BorderWidth = new Unit(2, UnitType.Pixel); cal.ToolTip = "Mois #" + (nbMonthsToAdd + 1); return(cal); }
void cal_SelectionChanged(Object sender, EventArgs e) { Calendar cal = (Calendar)sender; DateTime d = cal.SelectedDate; Calendar newCal = (Calendar)this.plhDailyEditorCal.Controls[0]; newCal.SelectionMode = CalendarSelectionMode.None; newCal.SelectedDate = d; newCal.VisibleDate = d; this.lblDateSel.Text = d.ToString("yyyy-MM-dd"); this.pnlDailyEditor.Visible = true; loadDataset(); DataRow[] rowz = _dataset.Tables["dailynotes"].Select(String.Format("id_cal={0} AND notedate='{1}'", CurrentCalendarID, d.ToShortDateString())); if (rowz.Length > 0) { this.txtDailyNotes.Text = rowz[0]["note"].ToString(); this.btnCopyDailyNoteToNotepad.Enabled = true; } else { this.txtDailyNotes.Text = String.Empty; this.btnCopyDailyNoteToNotepad.Enabled = false; } // retire la selection pour pouvoir éditer 2 fois en ligne la même date. cal.SelectedDate = DateTime.MinValue; return; }
private void loadCalspot() { Calendar calDaily = getCal(0); this.plhDailyEditorCal.Controls.Clear(); this.plhDailyEditorCal.Controls.Add(calDaily); this.tblCalspot.Rows.Clear(); TableRow r = null; TableCell c = null; Int32 m = 0; for (Int32 i = 0; i < 4; i++) { r = new TableRow(); for (Int32 j = 0; j < 3; j++) { c = new TableCell(); Calendar cal = getCal(m++); c.Controls.Add(cal); r.Cells.Add(c); } this.tblCalspot.Rows.Add(r); ajouteNotesMois(m - 3); } return; }
protected void ChangeDate(Object Sender, EventArgs e) { System.Web.UI.WebControls.Calendar _calendar = (System.Web.UI.WebControls.Calendar)Sender; DateTime _date = _calendar.SelectedDate; UpdateCalendars(_date); }
protected System.Web.UI.WebControls.Calendar PutCalendar(string indice) { System.Web.UI.WebControls.Calendar cln = new System.Web.UI.WebControls.Calendar(); cln.ID = "calendarioFecha_" + indice; cln.SelectionChanged += new EventHandler(this.Cambiar_Fecha); return(cln); }
protected override void CreateChildControls() { if (base.ListName == null || base.ListName == "") return; if (base.ChildControlsCreated) return; base.CreateChildControls(); Calendar cal = new Calendar(); cal.CellPadding = 0; cal.CssClass = "ms-picker-table"; cal.BorderWidth = new Unit(0); cal.Style.Clear(); cal.TitleStyle.CssClass = "ms-picker-header"; cal.DayHeaderStyle.CssClass = "ms-picker-dayheader"; cal.PrevMonthText = "<img border=0 alt='Previous Month' src='/_layouts/images/pickback.gif' >"; cal.NextMonthText = "<img border=0 alt='Next Month' src='/_layouts/images/pickforward.gif' >"; if (!this.Width.IsEmpty) cal.Width = this.Width; else cal.Width = new Unit("100%"); if (!this.Height.IsEmpty) cal.Height = this.Height; else cal.Height = new Unit("100%"); cal.DayRender += new DayRenderEventHandler(cal_DayRender); this.Controls.Add(cal); base.ChildControlsCreated = true; }
protected void gvRegistrations_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { HiddenField hidRegistrationID = (HiddenField)gvRegistrations.Rows[e.RowIndex].FindControl("hidRegistrationID"); TextBox tbPayment = (TextBox)gvRegistrations.Rows[e.RowIndex].FindControl("tbPayment"); DropDownList ddlPaymentType = (DropDownList)gvRegistrations.Rows[e.RowIndex].FindControl("ddlPaymentType"); System.Web.UI.WebControls.Calendar calPaymentDate = (System.Web.UI.WebControls.Calendar)gvRegistrations.Rows[e.RowIndex].FindControl("calPaymentDate"); DropDownList ddlRegStatus = (DropDownList)gvRegistrations.Rows[e.RowIndex].FindControl("ddlRegStatus"); if ((hidRegistrationID != null) && (tbPayment != null) && (ddlPaymentType != null) && (calPaymentDate != null) && (ddlRegStatus != null)) { SortedList sParam = new SortedList(); sParam.Add("@RegistrationID", hidRegistrationID.Value); sParam.Add("@RegistrationStatus", ddlRegStatus.SelectedValue); sParam.Add("@EventPaymentDate", calPaymentDate.SelectedDate); sParam.Add("@EventPaymentTypeID", ddlPaymentType.SelectedValue); sParam.Add("@EventPaymentAmount", tbPayment.Text); Classes.cUtilities.PerformNonQuery("uspInsUpdCMRegistrations", sParam, "LARPortal", Master.UserName); } } catch (Exception ex) { string l = ex.Message; } gvRegistrations.EditIndex = -1; PopulateGrid(); }
protected void Calendar1SelectionChanged(object sender, EventArgs e) { string temp = "No Events for today"; string category = ""; Calendar currentCal = sender as Calendar; if (currentCal != null) { _tempDate = currentCal.SelectedDate; } // fetch todays events from db List <IEvent> todaysEvents = GetEventsForToday(_tempDate).ToList(); if (todaysEvents.Any()) { temp = ""; } foreach (EventInfo item in todaysEvents) { item.Author = Members.GetAuthor(item.MemberId); switch (item.Type) { case 1: category = "Event"; break; case 2: category = "Birthday"; break; case 3: category = "Anniversary"; break; case 4: category = "Holiday"; break; case 5: category = "Special"; break; } temp += "Title : <a href=\"edit.aspx?ID=" + item.Id + "\">" + item.Title + "</a>" + //"<br/>Date : " + Item.EventDate.ToDateTime() + "<br/>" + item.Description + "<br/>Event Type : " + category + "<br/>Audience : " + item.Audience + "<br/>Added by : " + item.Author.Username + "<br/><br/>"; } daydetail_render.InnerHtml = temp; if (currentCal != null) { selectedday.InnerHtml = Common.TranslateNumerals(currentCal.SelectedDate.ToString("MMM d, yyyy")); } mpeModal.Show(); GetEvents(_tempDate.AddDays(-40), _tempDate.AddDays(40)); }
private Calendar GetPreviewCalendar() { Calendar wc = new Calendar { ShowTitle = this.calendar.ShowTitle, ShowNextPrevMonth = this.calendar.ShowNextPrevMonth, ShowDayHeader = this.calendar.ShowDayHeader, SelectionMode = this.calendar.SelectionMode }; ((WCScheme) this.schemeNameList.SelectedItem).Apply(wc); return wc; }
public static HtmlString RenderControl(int inc) { Calendar cal = new Calendar(); Page page = new Page(); page.Controls.Add(cal); using (StringWriter sw = new StringWriter()) { HttpContext.Current.Server.Execute("~/WebForm/WebForm1.aspx?inc=" + inc, sw, false); return new HtmlString(sw.ToString()); } }
protected void DropDownListExpireMonth_SelectedIndexChanged(object sender, EventArgs e) { DropDownList DropDownListExpYear = (DropDownList)MovieDetailsView.FindControl("DropDownListExpireYear"); DropDownList DropDownListExpMonth = (DropDownList)MovieDetailsView.FindControl("DropDownListExpireMonth"); int year = Convert.ToInt16(DropDownListExpYear.SelectedValue); int month = Convert.ToInt16(DropDownListExpMonth.SelectedValue); System.Web.UI.WebControls.Calendar expDateCalendar = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("expireDateCalendar"); expDateCalendar.VisibleDate = new DateTime(year, month, 1); expDateCalendar.SelectedDate = new DateTime(year, month, 1); expireDateCalendar_SelectionChanged(sender, e); }
/// <include file='doc\Calendar.uex' path='docs/doc[@for="Calendar.Calendar"]/*' /> public Calendar() : base() { _webCalendar = CreateWebCalendar(); _webCalendar.Visible = false; Controls.Add(_webCalendar); // Adding wrapper event handlers for event properties exposed by // the aggregated control. For more details about the mechanism, // please see the comment in the constructor of // Mobile.UI.AdRotator. EventHandler eventHandler = new EventHandler(WebSelectionChanged); _webCalendar.SelectionChanged += eventHandler; }
protected void DropDownListYear_SelectedIndexChanged(object sender, EventArgs e) { DropDownList DropDownListYear = (DropDownList)MovieDetailsView.FindControl("DropDownListYear"); DropDownList DropDownListMonth = (DropDownList)MovieDetailsView.FindControl("DropDownListMonth"); int year = Convert.ToInt16(DropDownListYear.SelectedValue); int month = Convert.ToInt16(DropDownListMonth.SelectedValue); System.Web.UI.WebControls.Calendar startDateCalendar = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("startDateCalendar"); startDateCalendar.VisibleDate = new DateTime(year, month, 1); startDateCalendar.SelectedDate = new DateTime(year, month, 1); // show selected Year in TextBox - startDateTextBox startDateCalendar_SelectionChanged(sender, e); }
private void redrawCalendar() { Int32 m = 0; for (Int32 i = 0; i < 8; i = i + 2) { for (Int32 j = 0; j < 3; j++) { TableCell c = this.tblCalspot.Rows[i].Cells[j]; Calendar cal = (Calendar)c.Controls[0]; cal.VisibleDate = new DateTime(_startYear, 1, 1).AddMonths(m++); } } return; }
protected void startDateCalendar_SelectionChanged(object sender, EventArgs e) { System.Web.UI.WebControls.Calendar calendar = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("startDateCalendar"); TextBox startDateTextBox = (TextBox)MovieDetailsView.FindControl("startDateTextBox"); startDateTextBox.Text = calendar.SelectedDate.ToShortDateString(); calendar.Visible = false; // get Year and Month on Calendar selectionChanged and change it in DropDownLists (Year and Month ddl's) string year1 = calendar.SelectedDate.Year.ToString(); string month1 = calendar.SelectedDate.Month.ToString(); DropDownList DropDownListYear = (DropDownList)MovieDetailsView.FindControl("DropDownListYear"); DropDownList DropDownListMonth = (DropDownList)MovieDetailsView.FindControl("DropDownListMonth"); DropDownListYear.Text = year1; DropDownListMonth.Text = month1; }
protected void expireDateCalendar_SelectionChanged(object sender, EventArgs e) { System.Web.UI.WebControls.Calendar calendar = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("expireDateCalendar"); TextBox expireDateTextBox = (TextBox)MovieDetailsView.FindControl("expireDateTextBox"); expireDateTextBox.Text = calendar.SelectedDate.ToShortDateString(); calendar.Visible = false; // get Year and Month on Calendar selectionChanged and change it in DropDownLists (Year and Month ddl's) string year2 = calendar.SelectedDate.Year.ToString(); string month2 = calendar.SelectedDate.Month.ToString(); DropDownList DropDownListExpYear = (DropDownList)MovieDetailsView.FindControl("DropDownListExpireYear"); DropDownList DropDownListExpMonth = (DropDownList)MovieDetailsView.FindControl("DropDownListExpireMonth"); //string year = DropDownListYear.Items.FindByValue(year2).ToString(); DropDownListExpYear.Text = year2; DropDownListExpMonth.Text = month2; }
public void Display(Control control) { var grup = this._dates.GroupBy(x => new { x.Year, x.Month }); //Calendar newCal = new Calendar(); foreach (var grouping in grup) { Calendar cal = new Calendar() ; cal.SelectionMode = CalendarSelectionMode.None; cal.ShowNextPrevMonth = false; cal.VisibleDate = new DateTime(grouping.Key.Year, grouping.Key.Month, 1); foreach (DateTime date in grouping) cal.SelectedDates.Add(date); control.Controls.Add(cal); } }
protected void btnCopyDailyNoteToNotepad_Click(Object sender, EventArgs e) { for (Int32 i = 1; i < _nbLineNotepad; i++) { TextBox t = (TextBox)FindControl(String.Format("notepadTextBox_{0}", i + 1)); if (t != null && t.Text == String.Empty) { Calendar cal = (Calendar)this.plhDailyEditorCal.Controls[0]; String stuff = this.txtDailyNotes.Text; t.ToolTip = stuff; if (stuff.Length > 45) { stuff = stuff.Substring(0, 45) + " ..."; } t.Text = String.Format("{0} - {1}", cal.SelectedDate.ToString("MMM-dd"), stuff); break; } } return; }
//创建子控件(服务器日历控件) protected override void CreateChildControls() { Controls.Clear(); _Calendar = new Calendar(); _Calendar.ID = MyCalendarID; _Calendar.SelectedDate = DateTime.Parse(Text); _Calendar.TitleFormat = TitleFormat.MonthYear; _Calendar.NextPrevFormat = NextPrevFormat.ShortMonth; _Calendar.CellSpacing = 0; _Calendar.Font.Size = FontUnit.Parse("9pt"); _Calendar.Font.Name = "Verdana"; _Calendar.SelectedDayStyle.BackColor = ColorTranslator.FromHtml("#333399"); _Calendar.SelectedDayStyle.ForeColor = ColorTranslator.FromHtml("White"); _Calendar.DayStyle.BackColor = ColorTranslator.FromHtml("#CCCCCC"); _Calendar.TodayDayStyle.BackColor = ColorTranslator.FromHtml("#999999"); _Calendar.TodayDayStyle.ForeColor = ColorTranslator.FromHtml("Aqua"); _Calendar.DayHeaderStyle.Font.Size = FontUnit.Parse("8pt"); _Calendar.DayHeaderStyle.Font.Bold = true; _Calendar.DayHeaderStyle.Height = Unit.Parse("8pt"); _Calendar.DayHeaderStyle.ForeColor = ColorTranslator.FromHtml("#333333"); _Calendar.NextPrevStyle.Font.Size = FontUnit.Parse("8pt"); _Calendar.NextPrevStyle.Font.Bold = true; _Calendar.NextPrevStyle.ForeColor = ColorTranslator.FromHtml("White"); _Calendar.TitleStyle.Font.Size = FontUnit.Parse("12pt"); _Calendar.TitleStyle.Font.Bold = true; _Calendar.TitleStyle.Height = Unit.Parse("12pt"); _Calendar.TitleStyle.ForeColor = ColorTranslator.FromHtml("White"); _Calendar.TitleStyle.BackColor = ColorTranslator.FromHtml("#333399"); _Calendar.OtherMonthDayStyle.ForeColor = ColorTranslator.FromHtml("#999999"); _Calendar.NextPrevFormat = NextPrevFormat.CustomText; _Calendar.NextMonthText = "下月"; _Calendar.PrevMonthText = "上月"; _Calendar.Style.Add("display", "none"); //默认不显示下拉日历控件 _Calendar.SelectionChanged += new EventHandler(_Calendar_SelectionChanged); this.Controls.Add(_Calendar); }
protected void SetUp() { this._ddlStartHour = new DropDownList(); this._ddlStartTime = new DropDownList(); this._ddlStartAmPm = new DropDownList(); this._ddlEndHour = new DropDownList(); this._ddlEndTime = new DropDownList(); this._ddlEndAmPm = new DropDownList(); this._txtComments = new TextBox(); this._txtProject = new TextBox(); this._ddlProjects = new DropDownList(); this._calStartDate = new Calendar(); this._calEndDate = new Calendar(); this._ProjectId = 2; this._AddNewProject = false; }
protected Control CreateControl(Type t) { PropertyInfo[] theProps = t.GetProperties(); Array.Sort(theProps, new PropertyInfoComparer()); HtmlTable table = new HtmlTable(); HtmlTableRow row = new HtmlTableRow(); HtmlTableCell cell = new HtmlTableCell(); cell.InnerHtml = "Zoek " + t.ToString(); cell.ColSpan = 2; row.Cells.Add(cell); table.Rows.Add(row); foreach (PropertyInfo propinfo in theProps) { row = new HtmlTableRow(); cell = new HtmlTableCell(); cell.InnerHtml = propinfo.Name; row.Cells.Add(cell); Control control = null; string ctrltype = propinfo.PropertyType.ToString(); string checktype = ctrltype.Substring(ctrltype.LastIndexOf('.')+1); string ctrlvalue = ""; if (!(checktype.Substring(0, 1) == "I" && Char.IsUpper(checktype.Substring(1, 1)[0]))) { switch (checktype) { case "DateTime": control = new Calendar(); ((Calendar)control).SelectedDate = new DateTime(2000,6,24); break; case "Boolean": control = new RadioButtonList(); ListItem liFalse = new ListItem("False", "false"); ListItem liTrue = new ListItem("True", "true"); ((RadioButtonList)control).Items.Add(liFalse); ((RadioButtonList)control).Items.Add(liTrue); ((RadioButtonList)control).SelectedValue = ctrlvalue; break; case "String": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; case "Int16": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; case "Int32": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; case "Decimal": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; default: DataSet ds; try { IDalSession session = NHSessionFactory.CreateSession(); ds = DataSetBuilder.CreateDataSetFromBusinessObjectList((IList)session.GetList(propinfo.PropertyType), "Key,Key"); session.Close(); } catch (Exception ex) { break; } control = new DropDownList(); ((DropDownList)control).DataSource = ds; ((DropDownList)control).DataBind(); if (ctrlvalue != null) ((DropDownList)control).Text = ctrlvalue; break; } if (control != null) { control.EnableViewState = true; control.ID = String.Concat(propinfo.Name, "_", checktype); cell = new HtmlTableCell(); cell.Controls.Add(control); row.Cells.Add(cell); // Add the control that indicates the AND/OR cell = new HtmlTableCell(); DropDownList dropdownlist = new DropDownList(); dropdownlist.ID = String.Concat("Operator_",propinfo.Name); ; dropdownlist.Items.Add("And"); dropdownlist.Items.Add("Or"); cell.Controls.Add(dropdownlist); row.Cells.Add(cell); table.Rows.Add(row); } } } return table; }
public CalendarAutoFormatDialog(Calendar calendar) { this.calendar = calendar; this.InitForm(); }
public static void ClearCalendar(Calendar wc) { wc.TitleStyle.Reset(); wc.NextPrevStyle.Reset(); wc.DayHeaderStyle.Reset(); wc.SelectorStyle.Reset(); wc.DayStyle.Reset(); wc.OtherMonthDayStyle.Reset(); wc.WeekendDayStyle.Reset(); wc.TodayDayStyle.Reset(); wc.SelectedDayStyle.Reset(); wc.ControlStyle.Reset(); }
protected Control CreateControl(Object p_infoobject, int level) { Type objectType = p_infoobject.GetType(); PropertyInfo[] theProps = objectType.GetProperties(); Array.Sort(theProps, new PropertyInfoComparer()); HtmlTable table = new HtmlTable(); HtmlTableRow row = new HtmlTableRow(); HtmlTableCell cell = new HtmlTableCell(); cell.InnerHtml = String.Concat("Object: ",InfoObject.ToString(), ", Type:", objectType.ToString()); cell.ColSpan = 2; row.Cells.Add(cell); table.Rows.Add(row); foreach (PropertyInfo propinfo in theProps) { row = new HtmlTableRow(); cell = new HtmlTableCell(); cell.InnerHtml = propinfo.Name; row.Cells.Add(cell); Control control = null; string ctrltype = propinfo.PropertyType.ToString(); string checktype = ctrltype.Substring(ctrltype.LastIndexOf('.') + 1); if (checktype != "Object") { Object propvalue = propinfo.GetValue(infoObject, null); string ctrlvalue = ""; if (propvalue != null) ctrlvalue = propvalue.ToString(); switch (checktype) { case "DateTime": control = new Calendar(); ((Calendar)control).SelectedDate = new DateTime(2000, 6, 24); break; case "Boolean": control = new RadioButtonList(); ListItem liFalse = new ListItem("False", "false"); ListItem liTrue = new ListItem("True", "true"); ((RadioButtonList)control).Items.Add(liFalse); ((RadioButtonList)control).Items.Add(liTrue); ((RadioButtonList)control).SelectedValue = ctrlvalue; ((RadioButtonList)control).RepeatDirection = RepeatDirection.Horizontal; break; case "String": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; case "Int16": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; case "Int32": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; case "Decimal": control = new TextBox(); if (ctrlvalue != null) ((TextBox)control).Text = ctrlvalue; break; default: DataSet ds; control = new DropDownList(); try { IDalSession session = NHSessionFactory.CreateSession(); if (propinfo.PropertyType == typeof(B4F.TotalGiro.Instruments.IInstrumentExchangeCollection)) ds = DataSetBuilder.CreateDataSetFromBusinessObjectList((IList)session.GetList(typeof(B4F.TotalGiro.Instruments.IExchange)), "Key,ExchangeName"); else ds = DataSetBuilder.CreateDataSetFromBusinessObjectList((IList)session.GetList(propinfo.PropertyType), "Key,Key"); session.Close(); } catch (Exception ex) { ((DropDownList)control).Text = ctrlvalue; break; } if (ds != null && ds.Tables.Count > 0) { ((DropDownList)control).DataSource = ds.Tables[0].DefaultView; ((DropDownList)control).DataBind(); } if (ctrlvalue != null) ((DropDownList)control).Text = ctrlvalue; break; } } if (control != null) { control.EnableViewState = true; control.ID = String.Concat(propinfo.Name, "_", checktype); cell = new HtmlTableCell(); cell.Controls.Add(control); row.Cells.Add(cell); table.Rows.Add(row); } } return table; }
protected void ctlCalendar_SelectionChanged(Object sender, EventArgs e) { System.Web.UI.WebControls.Calendar ctlCalendar = sender as System.Web.UI.WebControls.Calendar; Response.Redirect("~/Calendar/default.aspx?" + CalendarQueryString(ctlCalendar.SelectedDate)); //BindGrid(); }
protected override void CreateChildControls() { Controls.Clear(); //_dateTimeEdit _dateTimeEdit = new TextBox(); _dateTimeEdit.ID = "dateTimeEdit"; _dateTimeEdit.TextChanged += new EventHandler(dateTimeEdit_TextChanged); this.Controls.Add(_dateTimeEdit); //_imgButton _imgButton = new ImageButton(); _imgButton.ID = "imgButton"; _imgButton.Click += new ImageClickEventHandler(imgButton_Click); this.Controls.Add(_imgButton); //_hidTarget _hidTarget = new Button(); _hidTarget.ID = "hidTarget"; this.Controls.Add(_hidTarget); //_popupContainer _popupContainer = new Panel(); _popupContainer.ID = "popupContainer"; this.Controls.Add(_popupContainer); //_btnClose _btnClose = new ImageButton(); _btnClose.ID = "btnClose"; _btnClose.ImageUrl = "~/Image/Ajax/close.gif"; this.Controls.Add(_btnClose); //_ddlYear _ddlYear = new DropDownList(); _ddlYear.ID = "ddlYear"; _ddlYear.Width = new Unit(60, UnitType.Pixel); if (TraDate) { for (int i = this.MinYear - 1911; i <= this.MaxYear - 1911; i++) { _ddlYear.Items.Add(i.ToString()); } } else { for (int i = this.MinYear; i <= this.MaxYear; i++) { _ddlYear.Items.Add(i.ToString()); } } _ddlYear.AutoPostBack = true; _ddlYear.SelectedIndexChanged += new EventHandler(_ddlYear_SelectedIndexChanged); //_ddlMonth _ddlMonth = new DropDownList(); _ddlMonth.ID = "ddlMonth"; _ddlMonth.Width = new Unit(60, UnitType.Pixel); for (int i = 1; i <= 12; i++) { _ddlMonth.Items.Add(i.ToString()); } _ddlMonth.AutoPostBack = true; _ddlMonth.SelectedIndexChanged += new EventHandler(_ddlMonth_SelectedIndexChanged); //_calendar _calendar = new Calendar(); //_calendar.ShowTitle = false; _calendar.ID = "calendar"; _calendar.SkinID = "InnerDateTimePickerSkin1"; _calendar.VisibleMonthChanged += new MonthChangedEventHandler(_calendar_VisibleMonthChanged); _calendar.SelectionChanged += new EventHandler(calendar_SelectionChanged); string dateMessage = SysMsg.GetSystemMessage(CliUtils.fClientLang, "Srvtools", "WebDateTimePicker", "DateValues", true); string[] DateVals = dateMessage.Split(';'); //Table Table _innerTable = new Table(); //Row1 TableRow _innerRow1 = new TableRow(); TableCell _innerCell11 = new TableCell(); _innerCell11.Style.Add(HtmlTextWriterStyle.TextAlign, "center"); Label lblYear = new Label(); lblYear.Text = DateVals[0]; _innerCell11.Controls.Add(lblYear); _innerCell11.Controls.Add(_ddlYear); TableCell _innerCell12 = new TableCell(); _innerCell12.Style.Add(HtmlTextWriterStyle.TextAlign, "center"); Label lblMonth = new Label(); lblMonth.Text = DateVals[1]; _innerCell12.Controls.Add(lblMonth); _innerCell12.Controls.Add(_ddlMonth); _innerRow1.Cells.AddRange(new TableCell[] { _innerCell11, _innerCell12 }); //Row2 TableRow _innerRow2 = new TableRow(); TableCell _innerCell21 = new TableCell(); _innerCell21.ColumnSpan = 2; _innerCell21.Controls.Add(_calendar); _innerRow2.Cells.Add(_innerCell21); _innerTable.Rows.AddRange(new TableRow[] { _innerRow1, _innerRow2 }); //_updatePanel _updatePanel = new UpdatePanel(); _updatePanel.ID = "upDateContent"; _updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional; _updatePanel.ContentTemplateContainer.Controls.Add(_innerTable); AsyncPostBackTrigger trigger = new AsyncPostBackTrigger(); trigger.ControlID = this._imgButton.UniqueID; trigger.EventName = "Click"; _updatePanel.Triggers.Add(trigger); this.Controls.Add(_updatePanel); if (!this.DesignMode) { _modalPopupExtender = new ModalPopupExtender(); _modalPopupExtender.ID = "modalPopupExtender"; _modalPopupExtender.TargetControlID = this._hidTarget.UniqueID; _modalPopupExtender.PopupControlID = this._popupContainer.UniqueID; _modalPopupExtender.PopupDragHandleControlID = this._popupContainer.UniqueID; _modalPopupExtender.BackgroundCssClass = "ajaxdtp_modalBackground"; _modalPopupExtender.CancelControlID = this._btnClose.UniqueID; _modalPopupExtender.BehaviorID = this.ClientID + "_dateTimeShowModalBehavior"; //_modalPopupExtender.DropShadow = true; this.Controls.Add(_modalPopupExtender); } }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.FirstLetter; wc.NextPrevFormat = NextPrevFormat.FullMonth; wc.TitleFormat = TitleFormat.Month; wc.CellPadding = 2; wc.CellSpacing = 0; wc.ShowGridLines = false; wc.Height = Unit.Pixel(220); wc.Width = Unit.Pixel(400); wc.BackColor = Color.White; wc.BorderColor = Color.Black; wc.ForeColor = Color.Black; wc.Font.Name = "Times New Roman"; wc.Font.Size = FontUnit.Point(10); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.ForeColor = Color.White; wc.TitleStyle.BackColor = Color.Black; wc.TitleStyle.Font.Size = FontUnit.Point(13); wc.TitleStyle.Height = Unit.Point(14); wc.NextPrevStyle.ForeColor = Color.White; wc.NextPrevStyle.Font.Size = FontUnit.Point(8); wc.DayHeaderStyle.Font.Bold = true; wc.DayHeaderStyle.Font.Size = FontUnit.Point(7); wc.DayHeaderStyle.Font.Name = "Verdana"; wc.DayHeaderStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.DayHeaderStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33); wc.DayHeaderStyle.Height = Unit.Pixel(10); wc.SelectorStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.SelectorStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33); wc.SelectorStyle.Font.Bold = true; wc.SelectorStyle.Font.Size = FontUnit.Point(8); wc.SelectorStyle.Font.Name = "Verdana"; wc.SelectorStyle.Width = Unit.Percentage(1.0); wc.DayStyle.Width = Unit.Percentage(14.0); wc.TodayDayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0x99); wc.SelectedDayStyle.BackColor = Color.FromArgb(0xcc, 0x33, 0x33); wc.SelectedDayStyle.ForeColor = Color.White; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99); }
protected override void InitializeSkin(System.Web.UI.Control Skin) { cDate=(Calendar)Skin.FindControl("cDate"); cDate.SelectionChanged += new EventHandler(cDate_SelectionChanged); //throw new NotImplementedException(); }
private void calBlogNav_SelectionChanged(object sender, EventArgs e) { System.Web.UI.WebControls.Calendar cal = (System.Web.UI.WebControls.Calendar)sender; CalendarDate = cal.SelectedDate; RedirectFromCalendar(); }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.Short; wc.NextPrevFormat = NextPrevFormat.FullMonth; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 2; wc.CellSpacing = 0; wc.ShowGridLines = false; wc.Height = Unit.Pixel(190); wc.Width = Unit.Pixel(350); wc.BorderColor = Color.White; wc.BorderWidth = Unit.Pixel(1); wc.ForeColor = Color.Black; wc.BackColor = Color.White; wc.Font.Name = "Verdana"; wc.Font.Size = FontUnit.Point(9); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.BorderColor = Color.Black; wc.TitleStyle.BorderWidth = Unit.Pixel(4); wc.TitleStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x99); wc.TitleStyle.BackColor = Color.White; wc.TitleStyle.Font.Size = FontUnit.Point(12); wc.NextPrevStyle.Font.Bold = true; wc.NextPrevStyle.Font.Size = FontUnit.Point(8); wc.NextPrevStyle.VerticalAlign = VerticalAlign.Bottom; wc.NextPrevStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33); wc.DayHeaderStyle.Font.Bold = true; wc.DayHeaderStyle.Font.Size = FontUnit.Point(8); wc.TodayDayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.SelectedDayStyle.BackColor = Color.FromArgb(0x33, 0x33, 0x99); wc.SelectedDayStyle.ForeColor = Color.White; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99); }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.Short; wc.NextPrevFormat = NextPrevFormat.CustomText; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 2; wc.CellSpacing = 0; wc.ShowGridLines = false; }
protected void gvRegistrations_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) > 0) { DataRowView dRow = e.Row.DataItem as DataRowView; System.Web.UI.WebControls.Calendar calPaymentDate = (System.Web.UI.WebControls.Calendar)e.Row.FindControl("calPaymentDate"); if (calPaymentDate != null) { calPaymentDate.SelectedDate = DateTime.Today; HiddenField hidPaymentDate = (HiddenField)e.Row.FindControl("hidPaymentDate"); if (hidPaymentDate != null) { DateTime dtPaymentDate; if (DateTime.TryParse(hidPaymentDate.Value, out dtPaymentDate)) { calPaymentDate.SelectedDate = dtPaymentDate; } } } DropDownList ddlPaymentType = (DropDownList)e.Row.FindControl("ddlPaymentType"); if (ddlPaymentType != null) { ddlPaymentType.DataSource = _dtCampaignPaymentTypes; ddlPaymentType.DataTextField = "Description"; ddlPaymentType.DataValueField = "PaymentTypeID"; ddlPaymentType.DataBind(); HiddenField hidPaymentTypeID = (HiddenField)e.Row.FindControl("hidPaymentTypeID"); if (hidPaymentTypeID != null) { foreach (ListItem li in ddlPaymentType.Items) { if (li.Value == hidPaymentTypeID.Value) { li.Selected = true; } } } } DropDownList ddlRegStatus = (DropDownList)e.Row.FindControl("ddlRegStatus"); if (ddlRegStatus != null) { ddlRegStatus.DataSource = _dtRegStatus; ddlRegStatus.DataTextField = "StatusName"; ddlRegStatus.DataValueField = "StatusID"; ddlRegStatus.DataBind(); HiddenField hidRegStatusID = (HiddenField)e.Row.FindControl("hidRegistrationStatusID"); if (hidRegStatusID != null) { foreach (ListItem li in ddlRegStatus.Items) { if (li.Value == hidRegStatusID.Value) { li.Selected = true; } } } } } } }
public abstract void Apply(Calendar wc);
/* * <asp:Calendar ID="ctlCalendar" Width="100%" CssClass="monthBox" ShowGridLines="true" * CalendarSelectionMode="DayWeek" OnSelectionChanged="ctlCalendar_SelectionChanged" OnDayRender="ctlCalendar_DayRender" * Runat="server"> * <TitleStyle CssClass="monthHeader monthHeaderH3" /> * <NextPrevStyle CssClass="monthHeader monthFooterPrev" /> * <DayHeaderStyle CssClass="monthCalBodyTHDay" /> * <DayStyle CssClass="monthCalBodyWeekDay monthCalBodyWeekDayDateLink" VerticalAlign="Top" /> * <TodayDayStyle CssClass="monthCalBodyTodayWeekDay monthCalBodyWeekDayDateLink" VerticalAlign="Top" /> * <WeekendDayStyle CssClass="monthCalBodyWeekEnd monthCalBodyWeekDayDateLink" VerticalAlign="Top" /> * <OtherMonthDayStyle CssClass="monthCalBodyWeekDay" ForeColor="#fafafa" VerticalAlign="Top" /> * </asp:Calendar> */ protected void BindGrid() { try { tblDailyCalTable.Rows.Clear(); for (int nQuarter = 0; nQuarter < 4; nQuarter++) { HtmlTableRow tr = new HtmlTableRow(); tblDailyCalTable.Rows.Add(tr); for (int nQMonth = 1; nQMonth <= 3; nQMonth++) { HtmlTableCell td = new HtmlTableCell(); tr.Cells.Add(td); td.VAlign = "top"; td.Align = "center"; td.Attributes.Add("class", "yearCalBodyMonth"); DateTime dtCurrentMonth = new DateTime(dtCurrentDate.Year, 3 * nQuarter + nQMonth, 1); try { // 09/30/2005 Paul. Attempt to keep the day, but prevent a date overflow. if (dtCurrentDate.Day <= dtCurrentMonth.AddMonths(1).AddDays(-1).Day) { dtCurrentMonth = dtCurrentMonth.AddDays(dtCurrentDate.Day - 1); } else { dtCurrentMonth = dtCurrentMonth.AddMonths(1).AddDays(-1); } } catch (Exception ex) { SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex); } HyperLink lnkMonth = new HyperLink(); td.Controls.Add(lnkMonth); lnkMonth.CssClass = "yearCalBodyMonthLink"; lnkMonth.Text = dtCurrentMonth.ToString("MMMM"); lnkMonth.NavigateUrl = "Month.aspx?" + CalendarQueryString(dtCurrentMonth); System.Web.UI.WebControls.Calendar cal = new System.Web.UI.WebControls.Calendar(); td.Controls.Add(cal); cal.VisibleDate = new DateTime(dtCurrentDate.Year, 3 * nQuarter + nQMonth, 1); cal.Width = new Unit(100, UnitType.Percentage); cal.CssClass = "monthBox"; cal.ShowGridLines = true; cal.ShowTitle = false; cal.ShowNextPrevMonth = false; cal.SelectionMode = CalendarSelectionMode.Day; cal.TitleStyle.CssClass = "monthHeader monthHeaderH3"; cal.DayHeaderStyle.CssClass = "monthCalBodyTHDay"; cal.DayStyle.CssClass = "monthCalBodyWeekDay monthCalBodyWeekDayDateLink"; cal.TodayDayStyle.CssClass = "monthCalBodyTodayWeekDay monthCalBodyWeekDayDateLink"; cal.WeekendDayStyle.CssClass = "monthCalBodyWeekEnd monthCalBodyWeekDayDateLink"; cal.OtherMonthDayStyle.CssClass = "monthCalBodyWeekDay"; cal.OtherMonthDayStyle.ForeColor = System.Drawing.Color.FromArgb(0xfa, 0xfa, 0xfa); //"#fafafa"; cal.SelectionChanged += new EventHandler(ctlCalendar_SelectionChanged); } } } catch (Exception ex) { SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex); lblError.Text = ex.Message; } }
protected void calendarImage2_Click(object sender, EventArgs e) { System.Web.UI.WebControls.Calendar cal = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("expireDateCalendar"); cal.Visible = true; }
/* <asp:Calendar ID="ctlCalendar" Width="100%" CssClass="monthBox" ShowGridLines="true" CalendarSelectionMode="DayWeek" OnSelectionChanged="ctlCalendar_SelectionChanged" OnDayRender="ctlCalendar_DayRender" Runat="server"> <TitleStyle CssClass="monthHeader monthHeaderH3" /> <NextPrevStyle CssClass="monthHeader monthFooterPrev" /> <DayHeaderStyle CssClass="monthCalBodyTHDay" /> <DayStyle CssClass="monthCalBodyWeekDay monthCalBodyWeekDayDateLink" VerticalAlign="Top" /> <TodayDayStyle CssClass="monthCalBodyTodayWeekDay monthCalBodyWeekDayDateLink" VerticalAlign="Top" /> <WeekendDayStyle CssClass="monthCalBodyWeekEnd monthCalBodyWeekDayDateLink" VerticalAlign="Top" /> <OtherMonthDayStyle CssClass="monthCalBodyWeekDay" ForeColor="#fafafa" VerticalAlign="Top" /> </asp:Calendar> */ protected void BindGrid() { try { tblDailyCalTable.Rows.Clear(); for(int nQuarter = 0; nQuarter < 4; nQuarter++) { HtmlTableRow tr = new HtmlTableRow(); tblDailyCalTable.Rows.Add(tr); for(int nQMonth = 1; nQMonth <= 3; nQMonth++) { HtmlTableCell td = new HtmlTableCell(); tr.Cells.Add(td); td.VAlign = "top"; td.Align = "center"; td.Attributes.Add("class", "yearCalBodyMonth"); DateTime dtCurrentMonth = new DateTime(dtCurrentDate.Year, 3 * nQuarter + nQMonth, 1); try { // 09/30/2005 Paul. Attempt to keep the day, but prevent a date overflow. if ( dtCurrentDate.Day <= dtCurrentMonth.AddMonths(1).AddDays(-1).Day ) dtCurrentMonth = dtCurrentMonth.AddDays(dtCurrentDate.Day-1); else dtCurrentMonth = dtCurrentMonth.AddMonths(1).AddDays(-1); } catch(Exception ex) { SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex.Message); } HyperLink lnkMonth = new HyperLink(); td.Controls.Add(lnkMonth); lnkMonth.CssClass = "yearCalBodyMonthLink"; lnkMonth.Text = dtCurrentMonth.ToString("MMMM"); lnkMonth.NavigateUrl = "Month.aspx?" + CalendarQueryString(dtCurrentMonth); System.Web.UI.WebControls.Calendar cal = new System.Web.UI.WebControls.Calendar(); td.Controls.Add(cal); cal.VisibleDate = new DateTime(dtCurrentDate.Year, 3 * nQuarter + nQMonth, 1); cal.Width = new Unit(100, UnitType.Percentage); cal.CssClass = "monthBox"; cal.ShowGridLines = true; cal.ShowTitle = false; cal.ShowNextPrevMonth = false; cal.SelectionMode = CalendarSelectionMode.Day; cal.TitleStyle.CssClass = "monthHeader monthHeaderH3"; cal.DayHeaderStyle.CssClass = "monthCalBodyTHDay"; cal.DayStyle.CssClass = "monthCalBodyWeekDay monthCalBodyWeekDayDateLink"; cal.TodayDayStyle.CssClass = "monthCalBodyTodayWeekDay monthCalBodyWeekDayDateLink"; cal.WeekendDayStyle.CssClass = "monthCalBodyWeekEnd monthCalBodyWeekDayDateLink"; cal.OtherMonthDayStyle.CssClass = "monthCalBodyWeekDay"; cal.OtherMonthDayStyle.ForeColor = System.Drawing.Color.FromArgb(0xfa, 0xfa, 0xfa);//"#fafafa"; cal.SelectionChanged += new EventHandler(ctlCalendar_SelectionChanged); } } } catch(Exception ex) { SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex.Message); lblError.Text = ex.Message; } }
/// <summary> /// Method used to define the querries and styling of the calendar /// </summary> protected override void CreateChildControls() { if (!_error) { try { base.CreateChildControls(); Page.ClientScript.RegisterClientScriptInclude("jQuery", "/_layouts/ncnewssite/jquery-1.4.2.min.js"); Page.ClientScript.RegisterClientScriptBlock(GetType(), "EventToolTip", _toolTipScript, true); _calendar = new Calendar { UseAccessibleHeader = false, CssClass = "MiniCalendar" }; _calendar.FirstDayOfWeek = FirstDayOfWeek; _calendar.DayRender += new DayRenderEventHandler(_calendar_DayRender); _calendar.VisibleMonthChanged += new MonthChangedEventHandler(_calendar_VisibleMonthChanged); _calendar.DataBinding += new EventHandler(_calendar_DataBinding); ApplyCalendarStyles(); _tip = new HtmlGenericControl("div"); _tip.Attributes.Add("class", "tip"); this.Controls.Add(_calendar); this.Controls.Add(_tip); _calendar.DataBind(); } catch (Exception ex) { HandleException(ex); } } }
private void ApplyCalendarStyles(Calendar c) { //Setup the CSS classes for the Calendar c.CssClass = "lCalendarStyle"; c.DayHeaderStyle.CssClass = "lCalendarDayNameRow"; c.DayStyle.CssClass = "lCalendarDay"; c.SelectedDayStyle.CssClass = "lCalendarDayLinked"; c.TodayDayStyle.CssClass = "lCalendarDayCurrent"; c.TitleStyle.CssClass = "lCalendarMonthYearRow"; c.NextPrevStyle.CssClass = "lCalendarNextPrevStyle"; c.OtherMonthDayStyle.CssClass = "lCalendarOtherMonthStyle"; c.SelectorStyle.CssClass = "lCalendarSelectorStyle"; c.WeekendDayStyle.CssClass = "lCalendarWeekendStyle"; //Force a few of my preferred settings. I don't feel like messing with CSS c.DayStyle.VerticalAlign = VerticalAlign.Top; }
protected void ChangeDate(Object Sender, EventArgs e) { System.Web.UI.WebControls.Calendar _calendar = (System.Web.UI.WebControls.Calendar)Sender; Response.Redirect(oPage.GetFullLink(intPage) + "?d=" + Server.UrlPathEncode(_calendar.SelectedDate.ToShortDateString())); }
protected void Page_Load(object sender, EventArgs e) { // check QueryString not null OR empty - if null OR empty redirect to Previous page if (Request.QueryString["Id"] == null || Request.QueryString["Id"] == "") { Response.Redirect("Default.aspx"); } movieID = Convert.ToInt32(Request.QueryString["Id"]); if (!IsPostBack) { MovieCatalogBL contextBL = new MovieCatalogBL(); try { var queryMovieByID2 = contextBL.GetMovieByID(movieID); // needs to be List MovieDetailsView.DataSource = queryMovieByID2.ToList(); MovieDetailsView.DataBind(); // find DropDownList control inside DetailsView DropDownList ddlHours = (DropDownList)MovieDetailsView.FindControl("ddlHours"); DropDownList ddlMinutes = (DropDownList)MovieDetailsView.FindControl("ddlMinutes"); DropDownList ddlSeconds = (DropDownList)MovieDetailsView.FindControl("ddlSeconds"); // Time DropDownList for (int index = 0; index < 24; index++) { ddlHours.Items.Add(index.ToString("00")); } for (int index = 0; index < 60; index++) { ddlMinutes.Items.Add(index.ToString("00")); ddlSeconds.Items.Add(index.ToString("00")); } // for Calendar control -- Year & Month DropDownLists LoadYears(); LoadMonths(); // for movie production (make) year LoadProductionYears(); DropDownList ddlProductionYear = (DropDownList)MovieDetailsView.FindControl("DropDownListProductionYear"); // set year in DropDownListProductionYear ddlProductionYear.Text = queryMovieByID2.FirstOrDefault().Year.ToString(); // get Duration of movie TimeSpan duration = queryMovieByID2.FirstOrDefault().Duration.Value; // set the text of ddl's for hours, minutes and seconds ddlHours.Text = duration.Hours.ToString("00"); ddlMinutes.Text = duration.Minutes.ToString("00"); ddlSeconds.Text = duration.Seconds.ToString("00"); // Fill CheckBoxLists with countries CheckBoxList ddlCountry = (CheckBoxList)MovieDetailsView.FindControl("ddlCountry"); ddlCountry.DataSource = CountriesList(); ddlCountry.DataBind(); CheckBoxList ddlCountriesIPTV = (CheckBoxList)MovieDetailsView.FindControl("ddlCountriesIPTV"); ddlCountriesIPTV.DataSource = CountriesList(); ddlCountriesIPTV.DataBind(); CheckBoxList ddlCountriesVOD = (CheckBoxList)MovieDetailsView.FindControl("ddlCountriesVOD"); ddlCountriesVOD.DataSource = CountriesList(); ddlCountriesVOD.DataBind(); // select countries in ddlCountry string countriesMovie = queryMovieByID2.FirstOrDefault().Country; //Convert the string into an array of words string[] countryArray = countriesMovie.Split(new char[] { '?', '!', ';', ':', ',' }, StringSplitOptions.RemoveEmptyEntries); // has to be 'ListItem' "(ListItem item in ddlCountry.Items)" -> NOT "var"(var item in ddlCountries.Items) foreach (ListItem item in ddlCountry.Items) { for (int k = 0; k < countryArray.Length; k++) { if (item.ToString().ToUpperInvariant() == countryArray[k].ToUpperInvariant().Trim()) { item.Selected = true; } } } // select countries in ddlIPTV string countriesIPTV = queryMovieByID2.FirstOrDefault().RightsIPTV; //Convert the string into an array of words string[] iptvArray = countriesIPTV.Split(new char[] { '?', '!', ';', ':', ',' }, StringSplitOptions.RemoveEmptyEntries); // has to be 'ListItem' "(ListItem item in ddlcountriesIPTV.Items)" -> NOT "var"(var item in ddlCountries.Items) foreach (ListItem item in ddlCountriesIPTV.Items) { for (int k = 0; k < iptvArray.Length; k++) { if (item.ToString().ToUpperInvariant() == iptvArray[k].ToUpperInvariant().Trim()) { item.Selected = true; } } } // select countries in ddlVOD string countriesVOD = queryMovieByID2.FirstOrDefault().RightsVOD; //Convert the string into an array of words string[] VODArray = countriesVOD.Split(new char[] { '?', '!', ';', ':', ',' }, StringSplitOptions.RemoveEmptyEntries); // has to be 'ListItem' "(ListItem item in ddlCountriesVOD.Items)" -> NOT "var"(var item in ddlCountriesVOD.Items) foreach (ListItem item in ddlCountriesVOD.Items) { for (int k = 0; k < VODArray.Length; k++) { if (item.ToString().ToUpperInvariant() == VODArray[k].ToUpperInvariant().Trim()) { item.Selected = true; } } } // set text/value in DropdDownCheckBox Controls: ddlAncillaryRights and ddlSVODRights string svodRights = queryMovieByID2.FirstOrDefault().SVODRights.ToString(); string ancillaryRights = queryMovieByID2.FirstOrDefault().AncillaryRights.ToString(); DropDownList ddlAncillaryRights = (DropDownList)MovieDetailsView.FindControl("ddlAncillaryRights"); DropDownList ddlSVODRights = (DropDownList)MovieDetailsView.FindControl("ddlSVODRights"); ddlAncillaryRights.Text = ancillaryRights; ddlSVODRights.Text = svodRights; // set the date in startDateCalendar and make it visible in control DateTime startDate = (DateTime)queryMovieByID2.First().StartDate; System.Web.UI.WebControls.Calendar startDateCalendar = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("startDateCalendar"); startDateCalendar.SelectedDate = startDate; startDateCalendar.VisibleDate = startDate; // set the Year and Month in ddlStartYear and ddlStartMonth DropDownList ddlStartYear = (DropDownList)MovieDetailsView.FindControl("DropDownListYear"); DropDownList ddlStartMonth = (DropDownList)MovieDetailsView.FindControl("DropDownListMonth"); ddlStartYear.Text = startDate.Year.ToString(); ddlStartMonth.Text = startDate.Month.ToString(); // set the date in expiryDateCalendar and make it visible in control DateTime expiryDate = (DateTime)queryMovieByID2.First().ExpireDate; System.Web.UI.WebControls.Calendar expiryDateCalendar = (System.Web.UI.WebControls.Calendar)MovieDetailsView.FindControl("expireDateCalendar"); expiryDateCalendar.SelectedDate = expiryDate; expiryDateCalendar.VisibleDate = expiryDate; // set the Year and Month in ddlExpiryYear and ddlExpiryMonth DropDownList ddlExpiryYear = (DropDownList)MovieDetailsView.FindControl("DropDownListExpireYear"); DropDownList ddlExpiryMonth = (DropDownList)MovieDetailsView.FindControl("DropDownListExpireMonth"); ddlExpiryYear.Text = expiryDate.Year.ToString(); ddlExpiryMonth.Text = expiryDate.Month.ToString(); } catch (Exception) { lblMessage.Text = "An error occurred. Please try again."; } } }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.FirstLetter; wc.NextPrevFormat = NextPrevFormat.CustomText; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 1; wc.CellSpacing = 0; wc.ShowGridLines = false; wc.Height = Unit.Pixel(200); wc.Width = Unit.Pixel(220); wc.BackColor = Color.White; wc.BorderColor = Color.FromArgb(0x33, 0x66, 0xcc); wc.BorderWidth = Unit.Pixel(1); wc.ForeColor = Color.FromArgb(0, 0x33, 0x99); wc.Font.Name = "Verdana"; wc.Font.Size = FontUnit.Point(8); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.Font.Size = FontUnit.Point(10); wc.TitleStyle.BackColor = Color.FromArgb(0, 0x33, 0x99); wc.TitleStyle.ForeColor = Color.FromArgb(0xcc, 0xcc, 0xff); wc.TitleStyle.BorderColor = Color.FromArgb(0x33, 0x66, 0xcc); wc.TitleStyle.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid; wc.TitleStyle.BorderWidth = Unit.Pixel(1); wc.TitleStyle.Height = Unit.Pixel(0x19); wc.NextPrevStyle.ForeColor = Color.FromArgb(0xcc, 0xcc, 0xff); wc.NextPrevStyle.Font.Size = FontUnit.Point(8); wc.DayHeaderStyle.BackColor = Color.FromArgb(0x99, 0xcc, 0xcc); wc.DayHeaderStyle.ForeColor = Color.FromArgb(0x33, 0x66, 0x66); wc.DayHeaderStyle.Height = Unit.Pixel(1); wc.SelectorStyle.BackColor = Color.FromArgb(0x99, 0xcc, 0xcc); wc.SelectorStyle.ForeColor = Color.FromArgb(0x33, 0x66, 0x66); wc.SelectedDayStyle.BackColor = Color.FromArgb(0, 0x99, 0x99); wc.SelectedDayStyle.ForeColor = Color.FromArgb(0xcc, 0xff, 0x99); wc.SelectedDayStyle.Font.Bold = true; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99); wc.TodayDayStyle.ForeColor = Color.White; wc.TodayDayStyle.BackColor = Color.FromArgb(0x99, 0xcc, 0xcc); wc.WeekendDayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xff); }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.Short; wc.NextPrevFormat = NextPrevFormat.ShortMonth; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 2; wc.CellSpacing = 1; wc.ShowGridLines = false; wc.Height = Unit.Pixel(250); wc.Width = Unit.Pixel(330); wc.BackColor = Color.White; wc.BorderColor = Color.Black; wc.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid; wc.ForeColor = Color.Black; wc.Font.Name = "Verdana"; wc.Font.Size = FontUnit.Point(9); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.ForeColor = Color.White; wc.TitleStyle.BackColor = Color.FromArgb(0x33, 0x33, 0x99); wc.TitleStyle.Font.Size = FontUnit.Point(12); wc.TitleStyle.Height = Unit.Point(12); wc.NextPrevStyle.Font.Bold = true; wc.NextPrevStyle.Font.Size = FontUnit.Point(8); wc.NextPrevStyle.ForeColor = Color.White; wc.DayHeaderStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33); wc.DayHeaderStyle.Font.Bold = true; wc.DayHeaderStyle.Font.Size = FontUnit.Point(8); wc.DayHeaderStyle.Height = Unit.Point(8); wc.DayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.TodayDayStyle.BackColor = Color.FromArgb(0x99, 0x99, 0x99); wc.TodayDayStyle.ForeColor = Color.White; wc.SelectedDayStyle.BackColor = Color.FromArgb(0x33, 0x33, 0x99); wc.SelectedDayStyle.ForeColor = Color.White; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99); }
// ======================= // Dynamic Control.ID // ======================= // In order to catch these values the dynamically generated controls // needs to be re-generated at Page_Load. // The important thing is to assign the same ID to each control. // The ViewState uses the ID property of the Control objects to reinstate the values. // // ======================= // Page.IsPostBack // ======================= // We set the contrro//s tested member with a value // only at the first time the page is loaded // // private void Page_Load(object sender, EventArgs e) { HtmlForm form1 = (HtmlForm) (HtmlForm)this.FindControl("Form1"); this.GHTTestBegin(form1); this.GHTSubTestBegin("Check PostBack"); try { if (this.Page.IsPostBack) { this.GHTSubTestAddResult("PostBack Worked!!!"); } } catch (Exception exception49) { // ProjectData.SetProjectError(exception49); Exception exception1 = exception49; this.GHTSubTestAddResult("Unxpected " + exception1.GetType().Name + " exception was caught-" + exception1.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("AdRotator.KeywordFilter,Target"); try { AdRotator rotator1 = new AdRotator(); rotator1.ID = "objAdRotatorAll"; base.GHTActiveForm.Controls.Add(rotator1); if (!this.Page.IsPostBack) { rotator1.KeywordFilter = "test"; rotator1.Target = "_blank"; } else { this.GHTSubTestAddResult(rotator1.KeywordFilter); this.GHTSubTestAddResult(rotator1.Target); } } catch (Exception exception50) { // ProjectData.SetProjectError(exception50); Exception exception2 = exception50; this.GHTSubTestAddResult("Unxpected " + exception2.GetType().Name + " exception was caught-" + exception2.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); Label label1 = new Label(); this.GHTSubTestBegin("Style.BorderColor,BorderWidth,BorderStyle,CssClass,ForeColor,Height,Width,BackColor"); try { label1.ID = "objStyleLabelAll"; base.GHTActiveForm.Controls.Add(label1); if (!this.Page.IsPostBack) { label1.Style["BorderColor"] = "ffffff"; label1.Style["ForeColor"] = "ffffff"; label1.Style["BackColor"] = "ffffff"; label1.Style["BorderWidth"] = "2"; label1.Style["BorderStyle"] = "3"; label1.Style["CssClass"] = "CssClass"; label1.Style["Height"] = "2"; label1.Style["Width"] = "2"; } else { this.GHTSubTestAddResult(label1.Style["BorderColor"]); this.GHTSubTestAddResult(label1.Style["ForeColor"]); this.GHTSubTestAddResult(label1.Style["BackColor"]); this.GHTSubTestAddResult(label1.Style["BorderWidth"]); this.GHTSubTestAddResult(label1.Style["BorderStyle"]); this.GHTSubTestAddResult(label1.Style["CssClass"]); this.GHTSubTestAddResult(label1.Style["Height"]); this.GHTSubTestAddResult(label1.Style["Width"]); } } catch (Exception exception51) { // ProjectData.SetProjectError(exception51); Exception exception3 = exception51; this.GHTSubTestAddResult("Unxpected " + exception3.GetType().Name + " exception was caught-" + exception3.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("FontInfo.Underline,Italic,Names,Overline,Size,Strikeout,Bold"); try { if (!this.Page.IsPostBack) { label1.Font.Underline = true; label1.Font.Italic = true; label1.Font.Names.SetValue("myfont", 1); label1.Font.Overline = true; label1.Font.Size = FontUnit.Medium; label1.Font.Strikeout = true; label1.Font.Bold = true; } else { this.GHTSubTestAddResult(label1.Font.Underline.ToString()); this.GHTSubTestAddResult(label1.Font.Italic.ToString()); this.GHTSubTestAddResult((string)(label1.Font.Names.GetValue(1))); this.GHTSubTestAddResult(label1.Font.Overline.ToString()); this.GHTSubTestAddResult(label1.Font.Size.ToString()); this.GHTSubTestAddResult(label1.Font.Strikeout.ToString()); this.GHTSubTestAddResult(label1.Font.Bold.ToString()); } } catch (IndexOutOfRangeException exception52) { this.GHTSubTestAddResult("Test passed"); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Control.Visible"); try { Button button1 = new Button(); button1.ID = "objControlAll"; base.GHTActiveForm.Controls.Add(button1); if (!this.Page.IsPostBack) { button1.Visible = false; } else { this.GHTSubTestAddResult(button1.Visible.ToString()); } } catch (Exception exception53) { // ProjectData.SetProjectError(exception53); Exception exception5 = exception53; this.GHTSubTestAddResult("Unxpected " + exception5.GetType().Name + " exception was caught-" + exception5.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("WebControl.AccessKey,Enabled,TabIndex,ToolTip"); try { Button button2 = new Button(); button2.ID = "objWebControlAll"; base.GHTActiveForm.Controls.Add(button2); if (!this.Page.IsPostBack) { button2.AccessKey = "F"; button2.Enabled = false; button2.TabIndex = 100; button2.ToolTip = "ToolTip"; } else { this.GHTSubTestAddResult(button2.AccessKey); this.GHTSubTestAddResult(button2.Enabled.ToString()); this.GHTSubTestAddResult(button2.TabIndex.ToString()); this.GHTSubTestAddResult(button2.ToolTip); } } catch (Exception exception54) { // ProjectData.SetProjectError(exception54); Exception exception6 = exception54; this.GHTSubTestAddResult("Unxpected " + exception6.GetType().Name + " exception was caught-" + exception6.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Button.CausesValidation,CommandArgument,CommandName,Text"); try { Button button3 = new Button(); button3.ID = "objButtonAll"; base.GHTActiveForm.Controls.Add(button3); if (!this.Page.IsPostBack) { button3.CausesValidation = true; button3.CommandArgument = "test"; button3.CommandName = "test"; button3.Text = "test"; } else { this.GHTSubTestAddResult(button3.CausesValidation.ToString()); this.GHTSubTestAddResult(button3.CommandArgument); this.GHTSubTestAddResult(button3.CommandName); this.GHTSubTestAddResult(button3.Text); } } catch (Exception exception55) { // ProjectData.SetProjectError(exception55); Exception exception7 = exception55; this.GHTSubTestAddResult("Unxpected " + exception7.GetType().Name + " exception was caught-" + exception7.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); DataGrid grid1 = new DataGrid(); grid1.ID = "objDataGrid"; grid1.AutoGenerateColumns = false; BoundColumn column1 = new BoundColumn(); column1.HeaderText = "IntegerValue"; column1.DataField = "IntegerValue"; grid1.Columns.Add(column1); column1 = new BoundColumn(); column1.HeaderText = "StringValue"; column1.DataField = "StringValue"; grid1.Columns.Add(column1); column1 = new BoundColumn(); column1.HeaderText = "CurrencyValue"; column1.DataField = "CurrencyValue"; grid1.Columns.Add(column1); HyperLinkColumn column4 = new HyperLinkColumn(); column4.HeaderText = "objHyperLinkColumn"; grid1.Columns.Add(column4); ButtonColumn column2 = new ButtonColumn(); column2.HeaderText = "ButtonColumn"; grid1.Columns.Add(column2); EditCommandColumn column3 = new EditCommandColumn(); column3.HeaderText = "EditCommandColumn"; grid1.Columns.Add(column3); grid1.DataSource = this.CreateDataSource(); grid1.DataBind(); base.GHTActiveForm.Controls.Add(grid1); this.GHTSubTestBegin("BoundColumn.All"); try { column1 = (BoundColumn) grid1.Columns[2]; if (!this.Page.IsPostBack) { column1.DataFormatString = "{0:C}"; column1.ReadOnly = true; column1.DataField = "IntegerValue"; } else { this.GHTSubTestAddResult(column1.DataFormatString); this.GHTSubTestAddResult(column1.ReadOnly.ToString()); this.GHTSubTestAddResult(column1.DataField); } } catch (Exception exception56) { // ProjectData.SetProjectError(exception56); Exception exception8 = exception56; this.GHTSubTestAddResult("Unxpected " + exception8.GetType().Name + " exception was caught-" + exception8.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLinkColumn.All"); try { if (!this.Page.IsPostBack) { column4.Text = "test"; column4.DataNavigateUrlFormatString = "test.aspx?id={0}"; column4.Target = "_blank"; column4.NavigateUrl = "test"; column4.DataTextField = "StringValue"; column4.DataNavigateUrlField = "StringValue"; column4.DataTextFormatString = "{0:C}"; } else { this.GHTSubTestAddResult(column4.Text); this.GHTSubTestAddResult(column4.DataNavigateUrlFormatString); this.GHTSubTestAddResult(column4.Target); this.GHTSubTestAddResult(column4.NavigateUrl); this.GHTSubTestAddResult(column4.DataTextField); this.GHTSubTestAddResult(column4.DataNavigateUrlField); this.GHTSubTestAddResult(column4.DataTextFormatString); } } catch (Exception exception57) { // ProjectData.SetProjectError(exception57); Exception exception9 = exception57; this.GHTSubTestAddResult("Unxpected " + exception9.GetType().Name + " exception was caught-" + exception9.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ButtonColumn.All"); try { column2 = (ButtonColumn) grid1.Columns[4]; if (!this.Page.IsPostBack) { column2.DataTextField = "StringValue"; //column2.ButtonType = (ButtonColumnType) "test"; column2.DataTextFormatString = "{0:C}"; } else { this.GHTSubTestAddResult(column2.DataTextField); this.GHTSubTestAddResult(((int) column2.ButtonType).ToString()); this.GHTSubTestAddResult(column2.DataTextFormatString); } } catch (Exception exception58) { // ProjectData.SetProjectError(exception58); Exception exception10 = exception58; this.GHTSubTestAddResult("Unxpected " + exception10.GetType().Name + " exception was caught-" + exception10.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("EditCommandColumn.All"); try { column3 = (EditCommandColumn) grid1.Columns[5]; if (!this.Page.IsPostBack) { column3.UpdateText = "test"; column3.CancelText = "test"; column3.EditText = "test"; column3.ButtonType = ButtonColumnType.PushButton; } else { this.GHTSubTestAddResult(column3.UpdateText); this.GHTSubTestAddResult(column3.CancelText); this.GHTSubTestAddResult(column3.EditText); this.GHTSubTestAddResult(((int) column3.ButtonType).ToString()); } } catch (Exception exception59) { // ProjectData.SetProjectError(exception59); Exception exception11 = exception59; this.GHTSubTestAddResult("Unxpected " + exception11.GetType().Name + " exception was caught-" + exception11.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Calendar.All"); try { Calendar calendar1 = new Calendar(); calendar1.ID = "objCalendarAll"; base.GHTActiveForm.Controls.Add(calendar1); if (!this.Page.IsPostBack) { calendar1.ShowDayHeader = true; calendar1.FirstDayOfWeek = FirstDayOfWeek.Tuesday; calendar1.SelectWeekText = "SelectWeekText"; calendar1.CellSpacing = 4; calendar1.CellPadding = 6; calendar1.SelectMonthText = "SelectMonthText"; calendar1.VisibleDate = DateTime.Now; calendar1.DayNameFormat = DayNameFormat.FirstTwoLetters; calendar1.ShowGridLines = true; calendar1.TodaysDate = DateTime.Now.AddDays(1); calendar1.ShowNextPrevMonth = true; calendar1.ShowTitle = true; calendar1.TitleFormat = TitleFormat.MonthYear; calendar1.NextMonthText = "NextMonthText"; calendar1.NextPrevFormat = NextPrevFormat.FullMonth; calendar1.PrevMonthText = "PrevMonthText"; calendar1.SelectionMode = CalendarSelectionMode.DayWeekMonth; } else { this.GHTSubTestAddResult(calendar1.ShowDayHeader.ToString()); this.GHTSubTestAddResult(((int) calendar1.FirstDayOfWeek).ToString()); this.GHTSubTestAddResult(calendar1.SelectWeekText); this.GHTSubTestAddResult(calendar1.CellSpacing.ToString()); this.GHTSubTestAddResult(calendar1.CellPadding.ToString()); this.GHTSubTestAddResult(calendar1.SelectMonthText); this.GHTSubTestAddResult(calendar1.VisibleDate.ToString()); this.GHTSubTestAddResult(((int) calendar1.DayNameFormat).ToString()); this.GHTSubTestAddResult(calendar1.ShowGridLines.ToString()); this.GHTSubTestAddResult(calendar1.TodaysDate.ToString()); this.GHTSubTestAddResult(calendar1.ShowNextPrevMonth.ToString()); this.GHTSubTestAddResult(calendar1.ShowTitle.ToString()); this.GHTSubTestAddResult(((int) calendar1.TitleFormat).ToString()); this.GHTSubTestAddResult(calendar1.NextMonthText); this.GHTSubTestAddResult(((int) calendar1.NextPrevFormat).ToString()); this.GHTSubTestAddResult(calendar1.PrevMonthText); this.GHTSubTestAddResult(((int) calendar1.SelectionMode).ToString()); } } catch (Exception exception60) { // ProjectData.SetProjectError(exception60); Exception exception12 = exception60; this.GHTSubTestAddResult("Unxpected " + exception12.GetType().Name + " exception was caught-" + exception12.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBox.TextAlign,Text,Checked,AutoPostBack"); try { CheckBox box2 = new CheckBox(); box2.ID = "objCheckBoxAll"; base.GHTActiveForm.Controls.Add(box2); if (!this.Page.IsPostBack) { box2.TextAlign = TextAlign.Left; box2.Text = "test"; box2.Checked = true; box2.Checked = true; } else { this.GHTSubTestAddResult(((int) box2.TextAlign).ToString()); this.GHTSubTestAddResult(box2.Text); this.GHTSubTestAddResult(box2.Checked.ToString()); this.GHTSubTestAddResult(box2.Checked.ToString()); } } catch (Exception exception61) { // ProjectData.SetProjectError(exception61); Exception exception13 = exception61; this.GHTSubTestAddResult("Unxpected " + exception13.GetType().Name + " exception was caught-" + exception13.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.RepeatColumns"); try { CheckBoxList list1 = new CheckBoxList(); list1.ID = "objCheckBoxListRepeatColumns"; base.GHTActiveForm.Controls.Add(list1); if (!this.Page.IsPostBack) { list1.RepeatColumns = 2; } else { this.GHTSubTestAddResult(list1.RepeatColumns.ToString()); } } catch (Exception exception62) { // ProjectData.SetProjectError(exception62); Exception exception14 = exception62; this.GHTSubTestAddResult("Unxpected " + exception14.GetType().Name + " exception was caught-" + exception14.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.TextAlign"); try { CheckBoxList list2 = new CheckBoxList(); list2.ID = "objCheckBoxListTextAlign"; base.GHTActiveForm.Controls.Add(list2); if (!this.Page.IsPostBack) { list2.TextAlign = TextAlign.Right; } else { this.GHTSubTestAddResult(((int) list2.TextAlign).ToString()); } } catch (Exception exception63) { // ProjectData.SetProjectError(exception63); Exception exception15 = exception63; this.GHTSubTestAddResult("Unxpected " + exception15.GetType().Name + " exception was caught-" + exception15.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.RepeatDirection"); try { CheckBoxList list3 = new CheckBoxList(); list3.ID = "objCheckBoxListRepeatDirection"; base.GHTActiveForm.Controls.Add(list3); if (!this.Page.IsPostBack) { list3.RepeatDirection = RepeatDirection.Horizontal; } else { this.GHTSubTestAddResult(((int) list3.RepeatDirection).ToString()); } } catch (Exception exception64) { // ProjectData.SetProjectError(exception64); Exception exception16 = exception64; this.GHTSubTestAddResult("Unxpected " + exception16.GetType().Name + " exception was caught-" + exception16.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.RepeatLayout"); try { CheckBoxList list4 = new CheckBoxList(); list4.ID = "objCheckBoxListRepeatLayout"; base.GHTActiveForm.Controls.Add(list4); if (!this.Page.IsPostBack) { list4.RepeatLayout = RepeatLayout.Table; } else { this.GHTSubTestAddResult(((int) list4.RepeatLayout).ToString()); } } catch (Exception exception65) { // ProjectData.SetProjectError(exception65); Exception exception17 = exception65; this.GHTSubTestAddResult("Unxpected " + exception17.GetType().Name + " exception was caught-" + exception17.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); TextBox box1 = new TextBox(); box1.ID = "objControlToValidate"; base.GHTActiveForm.Controls.Add(box1); this.GHTSubTestBegin("CompareValidator.Operator"); try { CompareValidator validator1 = new CompareValidator(); validator1.ID = "objCompareValidatorOperator"; validator1.ControlToValidate = "objControlToValidate"; base.GHTActiveForm.Controls.Add(validator1); if (!this.Page.IsPostBack) { validator1.Operator = ValidationCompareOperator.GreaterThan; } else { this.GHTSubTestAddResult(((int) validator1.Operator).ToString()); } } catch (Exception exception66) { // ProjectData.SetProjectError(exception66); Exception exception18 = exception66; this.GHTSubTestAddResult("Unxpected " + exception18.GetType().Name + " exception was caught-" + exception18.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CompareValidator.ControlToCompare"); try { CompareValidator validator2 = new CompareValidator(); validator2.ID = "objCompareValidatorControlToCompare"; validator2.ControlToValidate = "objControlToValidate"; base.GHTActiveForm.Controls.Add(validator2); if (!this.Page.IsPostBack) { validator2.ControlToValidate = "objControlToValidate"; } else { this.GHTSubTestAddResult(validator2.ControlToValidate); } } catch (Exception exception67) { // ProjectData.SetProjectError(exception67); Exception exception19 = exception67; this.GHTSubTestAddResult("Unxpected " + exception19.GetType().Name + " exception was caught-" + exception19.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CompareValidator.ValueToCompare"); try { CompareValidator validator3 = new CompareValidator(); validator3.ID = "objCompareValidatorValueToCompare"; validator3.ControlToValidate = "objControlToValidate"; base.GHTActiveForm.Controls.Add(validator3); if (!this.Page.IsPostBack) { validator3.ValueToCompare = "test"; } else { this.GHTSubTestAddResult(validator3.ValueToCompare); } } catch (Exception exception68) { // ProjectData.SetProjectError(exception68); Exception exception20 = exception68; this.GHTSubTestAddResult("Unxpected " + exception20.GetType().Name + " exception was caught-" + exception20.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HtmlButton.CausesValidation"); try { HtmlButton button4 = new HtmlButton(); button4.ID = "objHtmlButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button4); if (!this.Page.IsPostBack) { button4.CausesValidation = true; } else { this.GHTSubTestAddResult(button4.CausesValidation.ToString()); } } catch (Exception exception69) { // ProjectData.SetProjectError(exception69); Exception exception21 = exception69; this.GHTSubTestAddResult("Unxpected " + exception21.GetType().Name + " exception was caught-" + exception21.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HtmlInputImage.CausesValidation"); try { HtmlInputImage image1 = new HtmlInputImage(); image1.ID = "objHtmlInputImageCausesValidation"; base.GHTActiveForm.Controls.Add(image1); if (!this.Page.IsPostBack) { image1.CausesValidation = true; } else { this.GHTSubTestAddResult(image1.CausesValidation.ToString()); } } catch (Exception exception70) { // ProjectData.SetProjectError(exception70); Exception exception22 = exception70; this.GHTSubTestAddResult("Unxpected " + exception22.GetType().Name + " exception was caught-" + exception22.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HtmlInputButton.CausesValidation"); try { HtmlInputButton button5 = new HtmlInputButton(); button5.ID = "objHtmlInputButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button5); if (!this.Page.IsPostBack) { button5.CausesValidation = true; } else { this.GHTSubTestAddResult(button5.CausesValidation.ToString()); } } catch (Exception exception71) { // ProjectData.SetProjectError(exception71); Exception exception23 = exception71; this.GHTSubTestAddResult("Unxpected " + exception23.GetType().Name + " exception was caught-" + exception23.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.Text"); try { HyperLink link1 = new HyperLink(); link1.ID = "objHyperLinkText"; base.GHTActiveForm.Controls.Add(link1); if (!this.Page.IsPostBack) { link1.Text = "test"; } else { this.GHTSubTestAddResult(link1.Text); } } catch (Exception exception72) { // ProjectData.SetProjectError(exception72); Exception exception24 = exception72; this.GHTSubTestAddResult("Unxpected " + exception24.GetType().Name + " exception was caught-" + exception24.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.Target"); try { HyperLink link2 = new HyperLink(); link2.ID = "objHyperLinkTarget"; base.GHTActiveForm.Controls.Add(link2); if (!this.Page.IsPostBack) { link2.Target = "_blank"; } else { this.GHTSubTestAddResult(link2.Target); } } catch (Exception exception73) { // ProjectData.SetProjectError(exception73); Exception exception25 = exception73; this.GHTSubTestAddResult("Unxpected " + exception25.GetType().Name + " exception was caught-" + exception25.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.ImageUrl"); try { HyperLink link3 = new HyperLink(); link3.ID = "objHyperLinkImageUrl"; base.GHTActiveForm.Controls.Add(link3); if (!this.Page.IsPostBack) { link3.ImageUrl = "test"; } else { this.GHTSubTestAddResult(link3.ImageUrl); } } catch (Exception exception74) { // ProjectData.SetProjectError(exception74); Exception exception26 = exception74; this.GHTSubTestAddResult("Unxpected " + exception26.GetType().Name + " exception was caught-" + exception26.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.NavigateUrl"); try { HyperLink link4 = new HyperLink(); link4.ID = "objHyperLinkNavigateUrl"; base.GHTActiveForm.Controls.Add(link4); if (!this.Page.IsPostBack) { link4.NavigateUrl = "test"; } else { this.GHTSubTestAddResult(link4.NavigateUrl); } } catch (Exception exception75) { // ProjectData.SetProjectError(exception75); Exception exception27 = exception75; this.GHTSubTestAddResult("Unxpected " + exception27.GetType().Name + " exception was caught-" + exception27.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Image.AlternateText"); try { Image image2 = new Image(); image2.ID = "objImageAlternateText"; base.GHTActiveForm.Controls.Add(image2); if (!this.Page.IsPostBack) { image2.AlternateText = "test"; } else { this.GHTSubTestAddResult(image2.AlternateText); } } catch (Exception exception76) { // ProjectData.SetProjectError(exception76); Exception exception28 = exception76; this.GHTSubTestAddResult("Unxpected " + exception28.GetType().Name + " exception was caught-" + exception28.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Image.ImageAlign"); try { Image image3 = new Image(); image3.ID = "objImageImageAlign"; base.GHTActiveForm.Controls.Add(image3); if (!this.Page.IsPostBack) { image3.ImageAlign = ImageAlign.Right; } else { this.GHTSubTestAddResult(((int) image3.ImageAlign).ToString()); } } catch (Exception exception77) { // ProjectData.SetProjectError(exception77); Exception exception29 = exception77; this.GHTSubTestAddResult("Unxpected " + exception29.GetType().Name + " exception was caught-" + exception29.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Image.ImageUrl"); try { Image image4 = new Image(); image4.ID = "objImageImageUrl"; base.GHTActiveForm.Controls.Add(image4); if (!this.Page.IsPostBack) { image4.ImageUrl = "test"; } else { this.GHTSubTestAddResult(image4.ImageUrl); } } catch (Exception exception78) { // ProjectData.SetProjectError(exception78); Exception exception30 = exception78; this.GHTSubTestAddResult("Unxpected " + exception30.GetType().Name + " exception was caught-" + exception30.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ImageButton.CommandName"); try { ImageButton button6 = new ImageButton(); button6.ID = "objImageButtonCommandName"; base.GHTActiveForm.Controls.Add(button6); if (!this.Page.IsPostBack) { button6.CommandName = "test"; } else { this.GHTSubTestAddResult(button6.CommandName); } } catch (Exception exception79) { // ProjectData.SetProjectError(exception79); Exception exception31 = exception79; this.GHTSubTestAddResult("Unxpected " + exception31.GetType().Name + " exception was caught-" + exception31.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ImageButton.CommandArgument"); try { ImageButton button7 = new ImageButton(); button7.ID = "objImageButtonCommandArgument"; base.GHTActiveForm.Controls.Add(button7); if (!this.Page.IsPostBack) { button7.CommandArgument = "test"; } else { this.GHTSubTestAddResult(button7.CommandArgument); } } catch (Exception exception80) { // ProjectData.SetProjectError(exception80); Exception exception32 = exception80; this.GHTSubTestAddResult("Unxpected " + exception32.GetType().Name + " exception was caught-" + exception32.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ImageButton.CommandName"); try { ImageButton button8 = new ImageButton(); button8.ID = "objImageButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button8); if (!this.Page.IsPostBack) { button8.CausesValidation = true; } else { this.GHTSubTestAddResult(button8.CausesValidation.ToString()); } } catch (Exception exception81) { // ProjectData.SetProjectError(exception81); Exception exception33 = exception81; this.GHTSubTestAddResult("Unxpected " + exception33.GetType().Name + " exception was caught-" + exception33.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Label.Text"); try { Label label2 = new Label(); label2.ID = "objLabelText"; base.GHTActiveForm.Controls.Add(label2); if (!this.Page.IsPostBack) { label2.Text = "test"; } else { this.GHTSubTestAddResult(label2.Text); } } catch (Exception exception82) { // ProjectData.SetProjectError(exception82); Exception exception34 = exception82; this.GHTSubTestAddResult("Unxpected " + exception34.GetType().Name + " exception was caught-" + exception34.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.CausesValidation"); try { LinkButton button9 = new LinkButton(); button9.ID = "objLinkButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button9); if (!this.Page.IsPostBack) { button9.CausesValidation = true; } else { this.GHTSubTestAddResult(button9.CausesValidation.ToString()); } } catch (Exception exception83) { // ProjectData.SetProjectError(exception83); Exception exception35 = exception83; this.GHTSubTestAddResult("Unxpected " + exception35.GetType().Name + " exception was caught-" + exception35.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.CommandName"); try { LinkButton button10 = new LinkButton(); button10.ID = "objLinkButtonCommandName"; base.GHTActiveForm.Controls.Add(button10); if (!this.Page.IsPostBack) { button10.CommandName = "test"; } else { this.GHTSubTestAddResult(button10.CommandName); } } catch (Exception exception84) { // ProjectData.SetProjectError(exception84); Exception exception36 = exception84; this.GHTSubTestAddResult("Unxpected " + exception36.GetType().Name + " exception was caught-" + exception36.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.CommandArgument"); try { LinkButton button11 = new LinkButton(); button11.ID = "objLinkButtonCommandArgument"; base.GHTActiveForm.Controls.Add(button11); if (!this.Page.IsPostBack) { button11.CommandArgument = "test"; } else { this.GHTSubTestAddResult(button11.CommandArgument); } } catch (Exception exception85) { // ProjectData.SetProjectError(exception85); Exception exception37 = exception85; this.GHTSubTestAddResult("Unxpected " + exception37.GetType().Name + " exception was caught-" + exception37.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.Text"); try { LinkButton button12 = new LinkButton(); button12.ID = "objLinkButtonText"; base.GHTActiveForm.Controls.Add(button12); if (!this.Page.IsPostBack) { button12.Text = "test"; } else { this.GHTSubTestAddResult(button12.Text); } } catch (Exception exception86) { // ProjectData.SetProjectError(exception86); Exception exception38 = exception86; this.GHTSubTestAddResult("Unxpected " + exception38.GetType().Name + " exception was caught-" + exception38.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ListBox.All"); try { ListBox box3 = new ListBox(); box3.ID = "objListBoxAll"; base.GHTActiveForm.Controls.Add(box3); if (!this.Page.IsPostBack) { box3.SelectionMode = ListSelectionMode.Multiple; box3.Rows = 2; } else { this.GHTSubTestAddResult(((int) box3.SelectionMode).ToString()); this.GHTSubTestAddResult(box3.Rows.ToString()); } } catch (Exception exception87) { // ProjectData.SetProjectError(exception87); Exception exception39 = exception87; this.GHTSubTestAddResult("Unxpected " + exception39.GetType().Name + " exception was caught-" + exception39.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ListControl.All"); try { ListBox box4 = new ListBox(); box4.ID = "objListControlAll"; box4.DataSource = this.CreateDataSource(); box4.DataBind(); base.GHTActiveForm.Controls.Add(box4); if (!this.Page.IsPostBack) { box4.AutoPostBack = true; box4.DataMember = "test"; box4.DataTextField = "StringValue"; box4.DataTextFormatString = "{0:C}"; box4.DataValueField = "StringValue"; } else { this.GHTSubTestAddResult(box4.AutoPostBack.ToString()); this.GHTSubTestAddResult(box4.DataMember); this.GHTSubTestAddResult(box4.DataTextField); this.GHTSubTestAddResult(box4.DataTextFormatString); this.GHTSubTestAddResult(box4.DataValueField); } } catch (Exception exception88) { // ProjectData.SetProjectError(exception88); Exception exception40 = exception88; this.GHTSubTestAddResult("Unxpected " + exception40.GetType().Name + " exception was caught-" + exception40.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Literal.Text"); try { Literal literal1 = new Literal(); literal1.ID = "objLiteralText"; base.GHTActiveForm.Controls.Add(literal1); if (!this.Page.IsPostBack) { literal1.Text = "test"; } else { this.GHTSubTestAddResult(literal1.Text); } } catch (Exception exception89) { // ProjectData.SetProjectError(exception89); Exception exception41 = exception89; this.GHTSubTestAddResult("Unxpected " + exception41.GetType().Name + " exception was caught-" + exception41.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Panel.All"); try { Panel panel1 = new Panel(); panel1.ID = "objPanelAll"; base.GHTActiveForm.Controls.Add(panel1); if (!this.Page.IsPostBack) { panel1.BackImageUrl = "test"; panel1.HorizontalAlign = HorizontalAlign.Right; panel1.Wrap = true; } else { this.GHTSubTestAddResult(panel1.BackImageUrl); this.GHTSubTestAddResult(((int) panel1.HorizontalAlign).ToString()); this.GHTSubTestAddResult(panel1.Wrap.ToString()); } } catch (Exception exception90) { // ProjectData.SetProjectError(exception90); Exception exception42 = exception90; this.GHTSubTestAddResult("Unxpected " + exception42.GetType().Name + " exception was caught-" + exception42.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButton.GroupName"); try { RadioButton button13 = new RadioButton(); button13.ID = "objRadioButtonGroupName"; base.GHTActiveForm.Controls.Add(button13); if (!this.Page.IsPostBack) { button13.GroupName = "test"; } else { this.GHTSubTestAddResult(button13.GroupName); } } catch (Exception exception91) { // ProjectData.SetProjectError(exception91); Exception exception43 = exception91; this.GHTSubTestAddResult("Unxpected " + exception43.GetType().Name + " exception was caught-" + exception43.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.RepeatColumns"); try { RadioButtonList list5 = new RadioButtonList(); list5.ID = "objRadioButtonListRepeatColumns"; base.GHTActiveForm.Controls.Add(list5); if (!this.Page.IsPostBack) { list5.RepeatColumns = 2; } else { this.GHTSubTestAddResult(list5.RepeatColumns.ToString()); } } catch (Exception exception92) { // ProjectData.SetProjectError(exception92); Exception exception44 = exception92; this.GHTSubTestAddResult("Unxpected " + exception44.GetType().Name + " exception was caught-" + exception44.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.RepeatDirection"); try { RadioButtonList list6 = new RadioButtonList(); list6.ID = "objRadioButtonListRepeatDirection"; base.GHTActiveForm.Controls.Add(list6); if (!this.Page.IsPostBack) { list6.RepeatDirection = RepeatDirection.Horizontal; } else { this.GHTSubTestAddResult(((int) list6.RepeatDirection).ToString()); } } catch (Exception exception93) { // ProjectData.SetProjectError(exception93); Exception exception45 = exception93; this.GHTSubTestAddResult("Unxpected " + exception45.GetType().Name + " exception was caught-" + exception45.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.TextAlign"); try { RadioButtonList list7 = new RadioButtonList(); list7.ID = "objRadioButtonListTextAlign"; base.GHTActiveForm.Controls.Add(list7); if (!this.Page.IsPostBack) { list7.TextAlign = TextAlign.Right; } else { this.GHTSubTestAddResult(((int) list7.TextAlign).ToString()); } } catch (Exception exception94) { // ProjectData.SetProjectError(exception94); Exception exception46 = exception94; this.GHTSubTestAddResult("Unxpected " + exception46.GetType().Name + " exception was caught-" + exception46.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.RepeatLayout"); try { RadioButtonList list8 = new RadioButtonList(); list8.ID = "objRadioButtonListRepeatLayout"; base.GHTActiveForm.Controls.Add(list8); if (!this.Page.IsPostBack) { list8.RepeatLayout = RepeatLayout.Flow; } else { this.GHTSubTestAddResult(((int) list8.RepeatLayout).ToString()); } } catch (Exception exception95) { // ProjectData.SetProjectError(exception95); Exception exception47 = exception95; this.GHTSubTestAddResult("Unxpected " + exception47.GetType().Name + " exception was caught-" + exception47.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("TextBox.ReadOnly,AutoPostBack,Columns,Wrap,Text,Rows,MaxLength,TextMode"); try { TextBox box5 = new TextBox(); box5.ID = "objTextBoxAll"; base.GHTActiveForm.Controls.Add(box5); if (!this.Page.IsPostBack) { box5.ReadOnly = true; box5.AutoPostBack = true; box5.Columns = 2; box5.Wrap = true; box5.Text = "test"; box5.Rows = 2; box5.MaxLength = 10; box5.TextMode = TextBoxMode.MultiLine; } else { this.GHTSubTestAddResult(box5.ReadOnly.ToString()); this.GHTSubTestAddResult(box5.ReadOnly.ToString()); this.GHTSubTestAddResult(box5.AutoPostBack.ToString()); this.GHTSubTestAddResult(box5.Columns.ToString()); this.GHTSubTestAddResult(box5.Wrap.ToString()); this.GHTSubTestAddResult(box5.Text); this.GHTSubTestAddResult(box5.Rows.ToString()); this.GHTSubTestAddResult(box5.MaxLength.ToString()); this.GHTSubTestAddResult(((int) box5.TextMode).ToString()); } } catch (Exception exception96) { // ProjectData.SetProjectError(exception96); Exception exception48 = exception96; this.GHTSubTestAddResult("Unxpected " + exception48.GetType().Name + " exception was caught-" + exception48.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTTestEnd(); }
private void CreateNonAjaxControls() { Table table = new Table(); table.CellPadding = 0; table.CellSpacing = 0; table.BorderWidth = 0; TableRow row1 = new TableRow(); TableCell cell1 = new TableCell(); //TextBox txtDate = new TextBox(); txtDate.ID = "txtDate"; txtDate.AutoPostBack = true; txtDate.TextChanged += new EventHandler(txtDate_TextChanged); txtDate.ReadOnly = this.ReadOnly; cell1.Controls.Add(txtDate); HtmlImage btnShowCalendar = new HtmlImage(); btnShowCalendar.Src = "./_layouts/images/calendar.gif"; btnShowCalendar.ID = "btnShowCalendar"; btnShowCalendar.Style.Add("cursor", "hand"); if (!ReadOnly) { btnShowCalendar.Attributes.Add("onclick", "ShowCalendar" + this.ClientID + "();return false;"); } cell1.Controls.Add(btnShowCalendar); //To add a space between the image and the message of the validators cell1.Controls.Add(new Label()); TableRow row2 = new TableRow(); row2.ID = "calendarRow"; row2.Style.Add("display", "none"); row2.Style.Add("position", "absolute"); row2.Style.Add("z-index", "1000"); TableCell cell2 = new TableCell(); Calendar calendar = new Calendar(); calendar.ID = "calendar"; calendar.Style.Add("z-index", "1"); calendar.SelectionChanged += new EventHandler(calendar_SelectionChanged); calendar.VisibleMonthChanged += new MonthChangedEventHandler(calendar_VisibleMonthChanged); calendar.Width = 180; calendar.Height = 150; calendar.SelectionMode = CalendarSelectionMode.Day; calendar.BorderColor = System.Drawing.Color.DarkBlue; calendar.SelectionMode = CalendarSelectionMode.Day; calendar.BackColor = System.Drawing.Color.White; calendar.DayStyle.Font.Size = 8; calendar.DayStyle.BackColor = System.Drawing.Color.LightBlue; calendar.CellPadding = 1; calendar.CellSpacing = 1; calendar.TitleStyle.Font.Size = 10; calendar.TitleStyle.Font.Bold = true; calendar.OtherMonthDayStyle.BackColor = System.Drawing.Color.DarkBlue; calendar.OtherMonthDayStyle.ForeColor = System.Drawing.Color.White; HtmlGenericControl iframe = new HtmlGenericControl("iframe"); iframe.ID = "iFrameCalendar"; iframe.Style.Add("position", "absolute"); iframe.Style.Add("z-index", "-1"); iframe.Style.Add("filter", "mask()"); iframe.Style.Add("border", "0"); iframe.Style.Add("margin", "0"); iframe.Style.Add("padding", "0"); iframe.Style.Add("top", "0"); iframe.Style.Add("left", "0"); iframe.Style.Add("width", string.Format("{0}px", calendar.Width)); iframe.Style.Add("height", string.Format("{0}px", calendar.Height)); iframe.Style.Add("overflow", "hidden"); cell2.Controls.Add(calendar); cell2.Controls.Add(iframe); AddValidators(ref cell1); row1.Cells.Add(cell1); row2.Cells.Add(cell2); table.Rows.Add(row1); table.Rows.Add(row2); this.Controls.Add(table); StringBuilder strBuilder = new StringBuilder(); strBuilder.Append("function ShowCalendar" + this.ClientID + "()" + Environment.NewLine); strBuilder.Append("{" + Environment.NewLine); strBuilder.Append(" if (document.getElementById('" + row2.ClientID + "').style.display == 'none')" + Environment.NewLine); strBuilder.Append(" document.getElementById('" + row2.ClientID + "').style.display = '';" + Environment.NewLine); strBuilder.Append(" else" + Environment.NewLine); strBuilder.Append(" document.getElementById('" + row2.ClientID + "').style.display = 'none';" + Environment.NewLine); strBuilder.Append(" }" + Environment.NewLine); this.Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "ShowCalendar" + this.ClientID, strBuilder.ToString(), true); CustomValidatorJavascriptValidation(); }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.FirstLetter; wc.NextPrevFormat = NextPrevFormat.CustomText; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 4; wc.CellSpacing = 0; wc.ShowGridLines = false; wc.Height = Unit.Pixel(180); wc.Width = Unit.Pixel(200); wc.BorderColor = Color.FromArgb(0x99, 0x99, 0x99); wc.ForeColor = Color.Black; wc.BackColor = Color.White; wc.Font.Name = "Verdana"; wc.Font.Size = FontUnit.Point(8); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.BorderColor = Color.Black; wc.TitleStyle.BackColor = Color.FromArgb(0x99, 0x99, 0x99); wc.NextPrevStyle.VerticalAlign = VerticalAlign.Bottom; wc.DayHeaderStyle.Font.Bold = true; wc.DayHeaderStyle.Font.Size = FontUnit.Point(7); wc.DayHeaderStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.SelectorStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.TodayDayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.TodayDayStyle.ForeColor = Color.Black; wc.SelectedDayStyle.BackColor = Color.FromArgb(0x66, 0x66, 0x66); wc.SelectedDayStyle.ForeColor = Color.White; wc.SelectedDayStyle.Font.Bold = true; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x80, 0x80, 0x80); wc.WeekendDayStyle.BackColor = Color.FromArgb(0xff, 0xff, 0xcc); }
protected void MeetingCalendar_Init(object sender, EventArgs e) { calendar = sender as Calendar; if (calendar == null) return; calendar.SelectedDate = DateTime.Now.Date; }
public CalendarAutoFormatDialog (Calendar calendar) { throw new NotImplementedException (); }
public static bool IsDateEmpty(this System.Web.UI.WebControls.Calendar calender) { return(calender.SelectedDates.Count == 0); }
protected override void Render(HtmlTextWriter writer) { base.Render(writer); HtmlTable table = new HtmlTable(); table.Border = 0; table.CellPadding = 0; table.CellSpacing = 1; table.Width = "100%"; table.ID = ClientID; for (int nQuarter = 0; nQuarter < 4; nQuarter++) { HtmlTableRow tr = new HtmlTableRow(); table.Rows.Add(tr); for (int nQMonth = 1; nQMonth <= 3; nQMonth++) { HtmlTableCell td = new HtmlTableCell(); tr.Cells.Add(td); td.VAlign = "top"; td.Align = "center"; td.Attributes.Add("class", "control-calendar-body-month"); DateTime dtCurrentMonth = new DateTime(WatchYear, 3 * nQuarter + nQMonth, 1); Label lblMonth = new Label(); td.Controls.Add(lblMonth); lblMonth.CssClass = "control-calendar-label"; lblMonth.Text = dtCurrentMonth.ToString("MMMM"); Calendar cal = new Calendar(); cal.ID = ClientID; td.Controls.Add(cal); cal.ToolTip = lblMonth.Text; cal.FirstDayOfWeek = FirstDayOfWeek.Monday; cal.VisibleDate = new DateTime(WatchYear, 3 * nQuarter + nQMonth, 1); cal.Width = new Unit(100, UnitType.Percentage); cal.CssClass = "control-calendar-month-box"; cal.ShowGridLines = true; cal.ShowTitle = false; cal.ShowNextPrevMonth = false; cal.SelectionMode = CalendarSelectionMode.None; cal.DayHeaderStyle.CssClass = "control-calendar-month-body-day-header"; cal.DayStyle.CssClass = "control-calendar-month-body-weekday"; cal.WeekendDayStyle.CssClass = "control-calendar-month-body-weekend"; cal.OtherMonthDayStyle.CssClass = "control-calendar-month-body-weekday"; cal.OtherMonthDayStyle.ForeColor = System.Drawing.Color.FromArgb(0xfa, 0xfa, 0xfa);//"#fafafa"; cal.DayRender += new DayRenderEventHandler(YearCalendar_RenderDay); } } table.RenderControl(writer); }