public void BuildImportControls(ControlCollection controls, System.Web.UI.Page page) { if (controls == null) throw new ArgumentNullException("controls"); if (page == null) throw new ArgumentNullException("page"); var isMessageAdded = controls.Contains(ErrorMessage); if (!isMessageAdded) { controls.Add(ErrorMessage); controls.Add(FeedbackMessage); } CurrentColllection = controls; ImportButton = UIControls.CreateImportButton(); ImportButton.Click += new EventHandler(ImportButton_Click); ImportTextBox = UIControls.CreateImportTextArea(); ImportZoneList = GetZoneList(page); var importPanel = new Panel(); importPanel.ID = "ImportControlsPanel"; importPanel.GroupingText = "Import"; importPanel.Controls.Add(UIControls.CreateLineBreak()); importPanel.Controls.Add(ImportZoneList); importPanel.Controls.Add(UIControls.CreateLineBreak()); importPanel.Controls.Add(ImportTextBox); importPanel.Controls.Add(UIControls.CreateLineBreak()); importPanel.Controls.Add(ImportButton); controls.Add(importPanel); }
public void BuildExportControls(ControlCollection controls, System.Web.UI.Page page) { if (controls == null) throw new ArgumentNullException("controls"); if (page == null) throw new ArgumentNullException("page"); var isMessageAdded = controls.Contains(ErrorMessage); if (!isMessageAdded) { controls.Add(ErrorMessage); controls.Add(FeedbackMessage); } CurrentColllection = controls; ExportButton = UIControls.CreateExportPortletButton(); ExportButton.Click += new EventHandler(ExportButton_Click); PortletList = GetPortletList(page); var exportPanel = new Panel(); exportPanel.ID = "ExportControlPanels"; exportPanel.GroupingText = "Export"; exportPanel.Controls.Add(UIControls.CreateLineBreak()); exportPanel.Controls.Add(PortletList); exportPanel.Controls.Add(ExportButton); controls.Add(exportPanel); }
protected override void CreateContent(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content) { content.Add(new Label() { ID = "lblZeilenNr", Text = "0", Visible = false }); content.Add(new Button() { ID = "btnUpdate", Text = "[+]", Width = new Unit(30, UnitType.Pixel), ToolTip = "Änderungen in Datenbank sichern", CausesValidation = this.CausesValidation, ValidationGroup = this.ValidationGroup, CommandName = "Update" }); content.Add(new Button() { ID = "btnCancel", Text = " / ", Width = new Unit(30, UnitType.Pixel), ToolTip = "Keine Änderungen in der Datenbank sichern", CausesValidation = this.CausesValidation, ValidationGroup = this.ValidationGroup, CommandName = "Cancel" }); }
/// <summary> /// Outputs the page navigation to the page. /// </summary> /// <param name="controlCollection">the pages' controls</param> /// <param name="path">The path of the current image directory being browsed</param> /// <param name="pageSize">The number of items on a page</param> /// <param name="maxIndex">The index of the last item on the last page</param> /// <param name="currIndex">The index of the first item in this page</param> public static void RendenderPageNavigation(System.Web.UI.ControlCollection controlCollection, string path, int pageSize, int maxIndex, int currIndex, System.Web.UI.Control ctrl) { if (maxIndex >= pageSize) { HyperLink h = null; // Previous-Button. if (currIndex >= pageSize) { h = new HyperLink(); int previousPageFirst = ((int)(currIndex / pageSize) - 1) * pageSize; h.NavigateUrl = ctrl.Page.GetPostBackClientHyperlink(ctrl, "directory;" + path + ";" + previousPageFirst.ToString()); h.Text = "1"; System.Web.UI.WebControls.Image prevImg = new System.Web.UI.WebControls.Image(); prevImg.ImageUrl = "NavPreviousSmall.gif"; prevImg.Attributes.Add("align", "middle"); h.Controls.Add(prevImg); controlCollection.Add(h); } // List all Pages. for (int index = 0; index <= maxIndex; index += pageSize) { h = new HyperLink(); if ((currIndex < index) || (currIndex >= index + pageSize)) { h.Text = (index / pageSize + 1).ToString() + " "; h.NavigateUrl = ctrl.Page.GetPostBackClientHyperlink(ctrl, "directory;" + path + ";" + index.ToString()); } else { h.Text = "[" + (index / pageSize + 1).ToString() + "] "; } h.Attributes.Add("class", "LinkButton"); controlCollection.Add(h); } // Next Button. if (currIndex < ((int)(maxIndex / pageSize)) * pageSize) { h = new HyperLink(); int nextPageFirst = ((int)(currIndex / pageSize) + 1) * pageSize; h.NavigateUrl = ctrl.Page.GetPostBackClientHyperlink(ctrl, "directory;" + path + ";" + nextPageFirst.ToString()); h.Text = "1"; System.Web.UI.WebControls.Image nextImg = new System.Web.UI.WebControls.Image(); nextImg.ImageUrl = "NavNextSmall.gif"; nextImg.Attributes.Add("align", "middle"); h.Controls.Add(nextImg); controlCollection.Add(h); } } }
/// <summary> /// Outputs some navigation links to the page. /// </summary> /// <param name="controlCollection">the pages' controls</param> /// <param name="path">The path of the current image directory being browsed</param> /// <param name="url">The URL to use in the links</param> public static void RendenderLinkPath(System.Web.UI.ControlCollection controlCollection, string path, System.Web.UI.Control ctrl, ImageBrowserConfig cfg) { HyperLink h = null; Literal l = null; DirectorySettingsHandler RootSettings = new DirectorySettingsHandler(cfg.PictureRootDirectory, "My Pictures"); if (path != null && path.Length > 0) { path = path.Replace(@"\", "/"); } else { h = new HyperLink(); h.NavigateUrl = ""; h.Text = RootSettings.DirectoryCaption; h.Attributes.Add("class", "LinkButton"); controlCollection.Add(h); return; } string[] paths = path.Split('/'); paths[0] = RootSettings.DirectoryCaption; for (int i = 1; i <= paths.Length; i++) { DirectorySettingsHandler DirSetting = new DirectorySettingsHandler( cfg.PictureRootDirectory + "\\" + string.Join("\\", paths, 0, i).Replace(RootSettings.DirectoryCaption, ""), paths[i - 1]); if (i < paths.Length) { h = new HyperLink(); h.NavigateUrl = ctrl.Page.GetPostBackClientHyperlink(ctrl, "directory;" + string.Join("/", paths, 0, i).Replace(RootSettings.DirectoryCaption, "") + ";0"); h.Text = DirSetting.DirectoryCaption; h.Attributes.Add("class", "LinkButton"); controlCollection.Add(h); l = new Literal(); l.Text = " » \n"; controlCollection.Add(l); } else { h = new HyperLink(); h.NavigateUrl = ""; h.Text = DirSetting.DirectoryCaption; h.Attributes.Add("class", "LinkButton"); controlCollection.Add(h); } } }
public void AllChildControlsLoopThroughEachChildControlsInControlCollectionTree() { var page = new Page(); var controlCollection = new ControlCollection(page); var control1 = new Control(); var control2 = new Control(); var childControl1 = new Control(); var childControl2 = new Control(); controlCollection.Add(control1); controlCollection.Add(control2); control2.Controls.Add(childControl1); control2.Controls.Add(childControl2); Assert.That(controlCollection.AllChildControls().Count(), Is.EqualTo(4)); }
public static void CreateControls(Action<HtmlWriter> rendering, ControlCollection controlCollection) { string html = HtmlWriter.Generate(rendering); if (string.IsNullOrEmpty(html)) return; var regex = new Regex(@"<\?UMBRACO_MACRO(?<property>\s*(?<name>[a-zA-Z_]+)=""(?<value>[^""]*)"")+\s*/>", RegexOptions.Singleline | RegexOptions.IgnoreCase); foreach (var extraction in regex.Extract(html)) { if (extraction.Type == RegexExtractionType.Text) controlCollection.Add(new LiteralControl(((RegexTextExtraction)extraction).Value)); else controlCollection.Add(LoadMacro(((RegexMatchExtraction)extraction).Value)); } }
public override ControlCollection GetControls(DataGridCommandEventArgs e) { DataGrid grid = Grid; ControlCollection controls = new ControlCollection(grid); foreach (TableCell cell in e.Item.Cells) { for (int i = 0; i < cell.Controls.Count; i++) controls.Add(cell.Controls[i]); } /* // What the scripts usually do, but our EDITOR_CELL is null. const int EDITOR_CELL = 8; TableCell o = e.Item.Cells[EDITOR_CELL]; DropDownList r = (DropDownList) o.FindControl(App.EDITOR); controls.Add(r); object o = e.Item.FindControl(App.EDITOR); // The template is in the DataGrid, just not in the event TableRow item = grid.Items[1]; foreach (TableCell cell in item.Cells) { for (int i = 0; i < cell.Controls.Count; i++) controls.Add(cell.Controls[i]); } */ return controls; }
public static void CreateModuleContent(Action<HtmlWriter> rendering, ControlCollection controlCollection, int? columnSpan) { string html = HtmlWriter.Generate(rendering); if (string.IsNullOrEmpty(html)) return; var regex = new Regex(@"<module ref=""(?<ref>\d+)""[^/]*/[^>]*>", RegexOptions.Singleline); foreach (var extraction in regex.Extract(html)) { if (extraction.Type == RegexExtractionType.Text) controlCollection.Add(new LiteralControl(((RegexTextExtraction)extraction).Value)); else controlCollection.Add(LoadModule(((RegexMatchExtraction)extraction).Value, columnSpan)); } }
public static void InitBookmarkingPage(ControlCollection c) { var provider = new BookmarkingScriptProvider(); BookmarkingSettings.ModuleId = BookmarkingConst.BookmarkingId; c.Add(provider); }
public static void SetBookmarkingActions(ControlCollection c) { var actions = GetBookmarkingActions(); if (0 < actions.Controls.Count) { c.Add(actions); } }
/* ===================================================================== Public methods */ public void AddToControls(ControlCollection controls) { var portletStart = this.InnerText.IndexOf("<td>") + 4; var beginTable = this.InnerText.Substring(0, portletStart); var portletEnd = this.InnerText.LastIndexOf("</td>"); var endTable = this.InnerText.Substring(portletEnd); var portlet = TypeHandler.CreateInstance("SenseNet.Portal.Portlets.ContentCollectionPortlet") as ContextBoundPortlet; portlet.ID = Guid.NewGuid().ToString(); portlet.CustomRootPath = this.CustomRootPath; portlet.Renderer = this.Renderer; portlet.RenderingMode = SenseNet.Portal.UI.PortletFramework.RenderMode.Xslt; portlet.BindTarget = BindTarget.CustomRoot; controls.Add(new LiteralControl { Text = beginTable }); controls.Add(portlet); controls.Add(new LiteralControl { Text = endTable }); }
/// <summary> /// Creates the child controls and handles adding the required field validator control. /// </summary> /// <param name="rockControl">The rock control.</param> /// <param name="controls">The controls.</param> public static void CreateChildControls( IRockControl rockControl, ControlCollection controls ) { if ( rockControl.RequiredFieldValidator != null ) { rockControl.RequiredFieldValidator.ID = rockControl.ID + "_rfv"; rockControl.RequiredFieldValidator.ControlToValidate = rockControl.ID; rockControl.RequiredFieldValidator.Display = ValidatorDisplay.Dynamic; rockControl.RequiredFieldValidator.CssClass = "validation-error help-inline"; rockControl.RequiredFieldValidator.Enabled = rockControl.Required; controls.Add( rockControl.RequiredFieldValidator ); } if ( rockControl.HelpBlock != null ) { rockControl.HelpBlock.ID = rockControl.ID + "_hb"; controls.Add( rockControl.HelpBlock ); } }
public static void SetBookmarkInfoActionsAndNavigation(ControlCollection c) { var actions = GetBookmarkInfoActions(); if (0 < actions.Controls.Count) { c.Add(actions); } SetBookmarkingNavigation(c); }
/// <summary> /// Moves controls from one control collection to the other. /// </summary> /// <param name="source">Source control collection. Will be /// emptied.</param> /// <param name="target">Target collection to be filled.</param> public static void MoveControls(ControlCollection source, ControlCollection target) { int count = source.Count; for (int i=0; i<count; i++) { Control ctrl = source[0]; source.RemoveAt(0); target.Add(ctrl); } }
/// <summary> /// Hängt die Representation dieses Newsfeeds der übergebenen Control-Collection an. /// </summary> /// <param name="CtrlCollection"></param> public void AddFeedRepresentation(System.Web.UI.ControlCollection CtrlCollection) { if (!DataExist) { throw new Exception(); } // Titel einfügen. Label TitleLbl = new Label(); TitleLbl.Text = Title; TitleLbl.CssClass = "NewsTitle"; CtrlCollection.Add(TitleLbl); CtrlCollection.Add(new LiteralControl("<br>")); // Limitieren der max. Anzahl der Artikel. int nCount = m_Feed.Items.Count; if (nCount > MaxNofItems) { nCount = MaxNofItems; } // Schlagzeilen einfügen. for (int nzIndex = 0; nzIndex < nCount; nzIndex++) { HyperLink HeadLineLink = new HyperLink(); HeadLineLink.Text = ArticleList[nzIndex].Title; HeadLineLink.NavigateUrl = ArticleList[nzIndex].Link; HeadLineLink.ToolTip = ArticleList[nzIndex].Description; HeadLineLink.Target = "_blank"; HeadLineLink.CssClass = "NewsItem"; // Die Daten an das NewsData-Objekt anhängen. CtrlCollection.Add(HeadLineLink); CtrlCollection.Add(new LiteralControl("<br>")); } }
public void MostrarMensaje(System.Web.UI.ControlCollection control, string message, bool cerrarPagina = false) { string str = null; if (cerrarPagina) { str = "<script language='JavaScript'>alert('" + message.Trim().Replace("'", "\\'").Replace(System.Environment.NewLine, "<br/>") + "'); CloseFormOK();</script>"; } else { str = "<script language='JavaScript'>alert('" + message.Trim().Replace("'", "\\'").Replace(System.Environment.NewLine, "<br/>") + "');</script>"; } control.Add(new LiteralControl(str)); }
private void AddControl(ControlCollection container, SenseNet.ContentRepository.Field field) { var control = GenericFieldControl.CreateDefaultFieldControl(field); control.ID = String.Concat("Generic", _id++); var fv = GenericFieldControl.GetFieldVisibility(ViewMode, field); if (fv == FieldVisibility.Advanced && AdvancedPanel != null) { AdvancedPanel.Controls.Add(control); } else { container.Add(control); } }
public static void AddScriptControl(ControlCollection container, string scriptLocation) { bool scriptControlFound = false; foreach (Control control in container) { HtmlGenericControl htmlControl = null; if (control is HtmlGenericControl) htmlControl = (HtmlGenericControl)control; if (htmlControl != null && htmlControl.Attributes["src"] != null && htmlControl.Attributes["src"].Trim().ToLower().IndexOf(scriptLocation.ToLower()) >= 0) { scriptControlFound = true; break; } } if (!scriptControlFound) container.Add(GetScriptControl(scriptLocation)); }
public void Deny_Unrestricted () { // note: using the same control (as owner) to add results // in killing the ms runtime with a stackoverflow - FDBK36722 ControlCollection cc = new ControlCollection (new Control ()); Assert.AreEqual (0, cc.Count, "Count"); Assert.IsFalse (cc.IsReadOnly, "IsReadOnly"); Assert.IsFalse (cc.IsSynchronized, "IsSynchronized"); Assert.IsNotNull (cc.SyncRoot, "SyncRoot"); cc.Add (control); Assert.IsNotNull (cc[0], "this[int]"); cc.Clear (); cc.AddAt (0, control); Assert.IsTrue (cc.Contains (control), "Contains"); cc.CopyTo (new Control[1], 0); Assert.IsNotNull (cc.GetEnumerator (), "GetEnumerator"); Assert.AreEqual (0, cc.IndexOf (control), "IndexOf"); cc.RemoveAt (0); cc.Remove (control); }
public void BuildToolbarButtons(ControlCollection controls) { if (controls == null) throw new ArgumentNullException("controls"); OverwritePortletRadioButton = UIControls.CreateOverwriteRadioButton(); ImportAllButton = UIControls.CreateImportAllButton(); ExportAllButton = UIControls.CreateExportAllButton(); ImportAllButton.Click += new EventHandler(ImportAllButton_Click); ExportAllButton.Click += new EventHandler(ExportAllButton_Click); controls.Add(UIControls.CreateLineBreak()); controls.Add(OverwritePortletRadioButton); controls.Add(ImportAllButton); controls.Add(UIControls.CreateLineBreak()); controls.Add(ExportAllButton); controls.Add(UIControls.CreateLineBreak()); }
protected override void CreateContent(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content) { var hinweis = new HtmlCtrl.P() { InnerText = EmptyDataText, CssStyleBld = EmptyDataTextStyle }; content.Add(hinweis); content.Add(new HtmlCtrl.BR()); var btnRemove = new Button() { Text = RemoveButtonCaption }; btnRemove.Attributes.Add("style", RemoveButtonStyle.ToString()); btnRemove.Click += new EventHandler(btnRemove_Click); content.Add(btnRemove); content.Add(new HtmlCtrl.BR()); // Alle aktuell gültigen Filter auflisten var fltTab = new System.Web.UI.HtmlControls.HtmlTable(); content.Add(fltTab); fltTab.Attributes.Add("style", CurrentlyActiveFiltersTabStyle.ToString()); var header = new System.Web.UI.HtmlControls.HtmlTableRow(); fltTab.Rows.Add(header); var col1Header = new System.Web.UI.HtmlControls.HtmlTableCell() { InnerText = "Filter" }; header.Cells.Add(col1Header); var col1HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellDescription); col1HeaderCssBld.FontWeight = new css.FontWeightMeasure() { Value = css.FontWeightMeasure.Unit.bold }; col1Header.Attributes.Add("style", col1HeaderCssBld.ToString()); var col2Header = new System.Web.UI.HtmlControls.HtmlTableCell() { InnerText = "entfernen ja/nein" }; header.Cells.Add(col2Header); var col2HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellAction); col2HeaderCssBld.FontWeight = new css.FontWeightMeasure() { Value = css.FontWeightMeasure.Unit.bold }; col2Header.Attributes.Add("style", col2HeaderCssBld.ToString()); int line = 0; foreach (var flt in sessVar.Filters) { var row = new System.Web.UI.HtmlControls.HtmlTableRow(); fltTab.Rows.Add(row); var descr = new System.Web.UI.HtmlControls.HtmlTableCell() { InnerText = flt.Value.Description }; descr.Attributes.Add("style", CurrentlyActiveFiltersTabCellDescription.ToString()); row.Cells.Add(descr); var action = new System.Web.UI.HtmlControls.HtmlTableCell(); action.Attributes.Add("style", CurrentlyActiveFiltersTabCellAction.ToString()); action.Controls.Add(new CheckBox() { ID = "cbxCtrl" + line++, ClientIDMode = ClientIDMode.Static, Checked = true }); row.Cells.Add(action); } }
public static string DayRender(ControlCollection objControls, DateTime dtaDa, DateTime dtaA, int IDCalendario, int IDGruppoBase, SqlConnection objCN) { string sSQL = @"SELECT Calendario.IDCal, Calendario.IDUser, Calendario.IDAss, Calendario.Data, Calendario.OraBegin, Calendario.OraEnd, Calendario.Oggetto, Calendario.IDOfferta, Calendario.bArchiviato, Calendario.timeCreator, UtenteCalendario.Nome, Calendario.IDCliente, Clienti.RagioneSoc as RagioneSociale FROM Calendario LEFT OUTER JOIN Clienti ON Calendario.IDCliente = Clienti.IDCliente LEFT OUTER JOIN users AS UtenteCalendario ON Calendario.IDUser = UtenteCalendario.IDUser WHERE (Data >= @DataDa) AND (Data <= @DataA)"; if (IDGruppoBase != -1) sSQL += " AND IDGruppoBase = @IDGruppoBase"; if (IDCalendario != -1) sSQL += " AND IDCal = @IDCal"; SqlCommand cmd = new SqlCommand(sSQL, objCN); SqlParameter parDataDa = new SqlParameter("DataDa", SqlDbType.DateTime); parDataDa.Value = dtaDa; cmd.Parameters.Add(parDataDa); SqlParameter parDataA = new SqlParameter("DataA", SqlDbType.DateTime); parDataA.Value = dtaA; cmd.Parameters.Add(parDataA); if (IDGruppoBase != -1) { SqlParameter parIDGruppoBase = new SqlParameter("IDGruppoBase", SqlDbType.Int); parIDGruppoBase.Value = IDGruppoBase; cmd.Parameters.Add(parIDGruppoBase); } if (IDCalendario != -1) { SqlParameter parIDCal = new SqlParameter("IDCal", SqlDbType.Int); parIDCal.Value = IDCalendario; cmd.Parameters.Add(parIDCal); } SqlDataReader sqlDR = null; try { objCN.Open(); sqlDR = cmd.ExecuteReader(); int iDiv = 900; string sLiteral = ""; //style='display: none; while (sqlDR.Read()) { iDiv++; sLiteral += @"<div STYLE=""display:none;"">"; string sIDDiv = "oIDDivCal" + dtaDa.Day + dtaDa.Month + iDiv.ToString(); //Preparo i dati memorizzati string sIDCal = sqlDR["IDCal"].ToString(); string sRagSoc = sqlDR["RagioneSociale"].ToString(); string sOggetto = sqlDR["Oggetto"].ToString(); string sNome = sqlDR["Nome"].ToString(); string sOraBegin = ((DateTime)sqlDR["Data"]).ToShortTimeString(); string sOraEnd = sqlDR["OraEnd"].ToString(); string sIDAss = sqlDR["IDAss"].ToString(); string stimeCreator = sqlDR["timeCreator"].ToString(); string sIDCliente = sqlDR["IDCliente"].ToString(); string sData = ((DateTime)sqlDR["Data"]).ToLongDateString(); string sIDOfferta = sqlDR["IDOfferta"].ToString(); //Inserisco L'utente a cui viene associato l'elemento Label lblNome = new Label(); lblNome.Text = sOraBegin + " - " + sqlDR["Nome"].ToString() + " "; lblNome.CssClass = "CalendarioNomeTecnico"; lblNome.Attributes.Add("onMouseOver", "fnViewDescription('" + sIDDiv + "');"); lblNome.Attributes.Add("onMouseOut", "fnHideDescription();"); objControls.Add(new LiteralControl("<br>")); objControls.Add(lblNome); //********************************************************************************************** //E' un assistenza if (((int)sqlDR["IDAss"]) != -1) { HyperLink hLink = new HyperLink(); string sText = ": "; string s = sRagSoc; int iMaxCar = 15; if (s.Length > iMaxCar) sText += s.Substring(0, iMaxCar); else sText += s; hLink.Text = sText; hLink.NavigateUrl = @"~/Assistenze/AssistenzaVisualizza.aspx?IDAss=" + sIDAss + "&IDCli=" + sIDCliente; hLink.CssClass = "CalendarioAssistenza"; objControls.Add(hLink); //****Preparazione DIV**** sLiteral += @"<div id='" + sIDDiv + @"'><table style="" border-right: #000000 thin solid; border-top: #000000 thin solid; font-size: 0.8em;border-left: #000000 thin solid; color: #17639a;border-bottom: #000000 thin solid;font-family: verdana;background-color: #e4e1e3"" cellpadding=""0"" cellspacing=""0""><tr> <td colspan=""2"" style="" font-weight: bold;height:14;font-size: 1.2em;color: #ffffff;font-style: normal;background-color: #006699; "">"; sLiteral += "Assistenza tecnica"; sLiteral += @"</td></tr><tr><td style="" width:auto;height:20;"">Utente designato:</td><td style=""width: 200px;"">"; sLiteral += sNome; sLiteral += @"</td></tr><tr><td style="" width:auto;height:20;"">Cliente:</td> <td style="" width:auto;height:20;"">"; sLiteral += sRagSoc; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Messaggio:</td> <td style=""width: 200px;"">"; sLiteral += sOggetto; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Data impegno:</td> <td style=""width: 200px;"">"; sLiteral += sData; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Ora fine:</td> <td style=""width: 200px;"">"; sLiteral += sOraBegin; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> IDAssistenza:</td> <td style=""width: 200px;"">"; sLiteral += sIDAss; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Data di creazione impegno:</td> <td style=""width: 200px;"">"; sLiteral += stimeCreator; sLiteral += @"</td></tr></table></div>"; //****FINE Preparaizione DIV**** }//E' Un scadenza con offerta else if (((int)sqlDR["IDOfferta"]) != -1) { HyperLink hLink = new HyperLink(); string sText = sqlDR["IDOfferta"].ToString() + ": "; string s = sqlDR["RagioneSociale"].ToString(); int iMaxCar = 15; if (s.Length > iMaxCar) sText += s.Substring(0, iMaxCar); else sText += s; hLink.Text = sText; hLink.NavigateUrl = @"~/Scadenze/GestioneOfferta.aspx?IDOfferta=" + sIDOfferta + "&IDCli=" + sIDCliente; hLink.CssClass = "CalendarioOfferta"; objControls.Add(hLink); //****Preparaizione DIV**** sLiteral += @"<div id='" + sIDDiv + @"'><table style="" border-right: #000000 thin solid; border-top: #000000 thin solid; font-size: 0.8em;border-left: #000000 thin solid; color: #003366;border-bottom: #000000 thin solid;font-family: verdana;background-color: #669999;"" cellpadding=""0"" cellspacing=""0""><tr><td colspan=""2"" style="" font-weight: bold;height:14;font-size: 1.2em;color: #ffffff;font-style: normal;background-color: #006699; "" cellpadding='0' cellspacing='0'><tr><td colspan=""2"" style="" font-weight: bold;height:14;font-size: 1.2em;color: #ffffff;font-style: normal;background-color: #006699; "">"; sLiteral += "Assistenza tecnica"; sLiteral += @"</td></tr><tr><td style="" width:auto;height:20;"">Utente designato:</td><td style= 'width: 100px'>"; sLiteral += sNome; sLiteral += @"</td></tr><tr><td style="" width:auto;height:20;"">Cliente:</td> <td style=""width: 200px;"">"; sLiteral += sRagSoc; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Messaggio:</td> <td style=""width: 200px;"">"; sLiteral += sOggetto; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Data impegno:</td> <td style=""width: 200px;"">"; sLiteral += sData; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Ora fine:</td> <td style=""width: 200px;"">"; sLiteral += sOraBegin; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> ID Offerta:</td> <td style=""width: 200px;"">"; sLiteral += sIDOfferta; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Data di creazione impegno:</td> <td style=""width: 200px;"">"; sLiteral += stimeCreator; sLiteral += @"</td></tr></table></div>"; //****FINE Preparaizione DIV**** }//E' un impegno generico else { Label lbl = new Label(); string sText = ": "; string s = sqlDR["Oggetto"].ToString(); int iMaxCar = 30; if (s.Length > iMaxCar) sText += s.Substring(0, iMaxCar); else sText += s; lbl.Text = sText; lbl.CssClass = "CalendarioGenerico"; objControls.Add(lbl); //****Preparazione DIV**** sLiteral += @"<div id='" + sIDDiv + @"'><table style="" border-right: #000000 thin solid; border-top: #000000 thin solid; font-size: 0.8em;border-left: #000000 thin solid; color: #174418;border-bottom: #000000 thin solid;font-family: verdana;background-color: #cbddc6;"" cellpadding=""0"" cellspacing=""0""><tr> <tr><td colspan=""2"" style="" font-weight: bold;height:14;font-size: 1.2em;color: #ffffff;font-style: normal;background-color: #99c699; "">"; sLiteral += "Impegno generico"; sLiteral += @"</td></tr><tr><td style="" width:auto;height:20;"">Utente designato:</td><td sstyle=""width: 200px;"">"; sLiteral += sNome; sLiteral += @"</td></tr><tr><td style="" width:auto;height:20;"">Cliente:</td> <td style=""width: 200px;"">"; sLiteral += sRagSoc; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Messaggio:</td> <td style=""width: 200px;"">"; sLiteral += sOggetto; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Data impegno:</td> <td style=""width: 200px;"">"; sLiteral += sData; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Ora fine:</td> <td style=""width: 200px;"">"; sLiteral += sOraBegin; sLiteral += @"</td> </tr> <tr> <td style="" width:auto;height:20;""> Data di creazione impegno:</td> <td style=""width: 200px;"">"; sLiteral += stimeCreator; sLiteral += @"</td></tr></table></div>"; //****FINE Preparaizione DIV**** } sLiteral += @"</div>"; //Aggiungo l'elemento per eseguire l'eliminazione HyperLink objHyperLink = new HyperLink(); objHyperLink.Text = " Elimina"; objHyperLink.Font.Size = 8; objHyperLink.ForeColor = Color.Tomato; objHyperLink.NavigateUrl = "./CommandCalendar.aspx?EliIDCal=" + sIDCal; objControls.Add((Control)objHyperLink); } sqlDR.Close(); return sLiteral; } catch { if (!sqlDR.IsClosed) sqlDR.Close(); return "Errore"; } finally { objCN.Close(); } }
// -------------------------------------------------------------------------- /// <summary> /// Adds "jump to previous page" button. /// </summary> /// <param name="PagerControls">ControlCollection of the pager</param> /// <param name="enabled">If false, we are already at the first page. /// Adds a simple image control /// </param> // -------------------------------------------------------------------------- private void AddButtonGoToPrev(ControlCollection PagerControls, bool enabled) { if (enabled) { LinkButton linkButtonPrev = new LinkButton(); linkButtonPrev.Text = "< elõzõ"; linkButtonPrev.ID = "GotoPrev"; linkButtonPrev.ToolTip = "Ugrás az elõzõ lapra"; linkButtonPrev.CausesValidation = false; linkButtonPrev.Click += new EventHandler(GoToPrevPage); linkButtonPrev.Style.Add("padding-left", "3px"); linkButtonPrev.Style.Add("padding-right", "3px"); PagerControls.Add(linkButtonPrev); } else { Label labelPrev = new Label(); labelPrev.Text = "< elõzõ"; labelPrev.CssClass = "Pager"; labelPrev.Style.Add("padding-left", "3px"); labelPrev.Style.Add("padding-right", "3px"); PagerControls.Add(labelPrev); } }
protected override void CreateFilterCtrl(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content) { content.Add( new HtmlCtrl.DIV() { CssStyleBld = new css.StyleBuilder() { Position = css.Position.Relative, Width = new css.LengthRealtive() { Value = 100 } }, Content = new Control[] { // Button: Beginns Zeitintervall zurücksetzen new HtmlCtrl.Button("btn" + ColName + "ResetStart") { CssStyleBld = new css.StyleBuilder() { TextAlign = css.TextAlign.Left, Width = new css.LengthPixel() { Value = 15 }, PaddingLeft = new css.LengthPixel() { Value = 2 }, PaddingRight = new css.LengthPixel() { Value = 2 } }, Text = "[", SetClick = new EventHandler(btnResetStart_Click) }, // Datumsbox Beginn Zeitintervall new HtmlCtrl.DateBox("dbx" + ColName + "FltBegin") { CssStyleBld = new css.StyleBuilder() { Width = new css.LengthPixel { Value = 70 } }, SetLoad = new EventHandler(_tbxBegin_Load), SetTextChanged = new EventHandler(_tbxBegin_TextChanged) }, new HtmlCtrl.BR(), // Button: Ende Zeitintervall zurücksetzen new HtmlCtrl.Button("btn" + ColName + "ResetEnd") { CssStyleBld = new css.StyleBuilder() { TextAlign = css.TextAlign.Right, Width = new css.LengthPixel() { Value = 15 }, PaddingLeft = new css.LengthPixel() { Value = 2 }, PaddingRight = new css.LengthPixel() { Value = 2 } }, Text = "]", SetClick = new EventHandler(btnResetEnd_Click) }, // Datumsbox End Zeitintervall new HtmlCtrl.DateBox("dbx" + ColName + "FltEnd") { CssStyleBld = new css.StyleBuilder() { Width = new css.LengthPixel { Value = 70 } }, SetLoad = new EventHandler(_tbxEnd_Load), SetTextChanged = new EventHandler(_tbxEnd_TextChanged) } } } ); }
public static void SetTagsCloud(ControlCollection c, string label, TagCloud tagCloud) { if (tagCloud.Items == null || tagCloud.Items.Count == 0) { return; } var ServiceHelper = BookmarkingServiceHelper.GetCurrentInstanse(); var tagsCloudContainer = new SideContainer() { Title = label, ImageURL = WebImageSupplier.GetAbsoluteWebPath("tag_32.png", BookmarkingConst.BookmarkingId) }; tagsCloudContainer.Controls.Add(tagCloud); c.Add(tagsCloudContainer); }
/// <summary> /// Moves all templated controls of a given region provider /// into their target regions. /// </summary> /// <param name="template">The template to be used.</param> /// <param name="controls">Controls to move into the template.</param> /// <param name="provider">Provides region assignements for the controls.</param> /// <param name="page">The currently rendered page.</param> protected static void HandleControls(IPortalTemplate template, RegionProvider provider, ControlCollection controls, Page page) { //force template control creation now by adding / removing the template Control templateControl = (Control)template; controls.Add(templateControl); controls.Remove(templateControl); //call initialization code of the template template.BeforeTemplating(page); //add defined controls to their target region RegionPlaceHolder placeHolder; foreach (RegionPropertySet propertySet in provider) { placeHolder = template[propertySet.TargetRegion]; if (placeHolder == null) { string msg = "Invalid region defined for control {0}. Template does not contain region '{1}'"; msg = String.Format(msg, propertySet.Control.ID, propertySet.TargetRegion); throw new ArgumentException(msg); } //remove templated control from original location... controls.Remove(propertySet.Control); //...and put it into placeholder placeHolder.Controls.Add(propertySet.Control); } //add remaining controls to default region, if any if (provider.DefaultRegion != PortalRegion.None) { placeHolder = template[provider.DefaultRegion]; if (placeHolder == null) { string msg = "Invalid default region defined: Template does not contain region '{0}'"; msg = String.Format(msg, provider.DefaultRegion); throw new ArgumentException(msg); } //move remaining controls into the template's controls ControlUtil.MoveControls(controls, placeHolder.Controls); } //Everything is now in the template. Now move all the template's //controls back into the page's control collection. This is necessary //to keep relative links of the web form working ControlUtil.MoveControls(templateControl.Controls, controls); //call initialization code of the template template.AfterTemplating(page); }
private void AddOptionsControl(string labelText, string id, string dataKey, Control control, ControlCollection controlCollection) { var label = new Label { Text = labelText, AssociatedControlID = id }; control.ID = id; control.ClientIDMode = ClientIDMode.Static; if (control is TextBox) { ((TextBox) control).CssClass = "chartSetting"; ((TextBox)control).Attributes.Add("data-key", dataKey); } else if (control is CheckBox) { ((CheckBox) control).CssClass = "chartSetting"; ((CheckBox) control).Attributes.Add("data-key", dataKey); } controlCollection.Add(label); controlCollection.Add(control); }
// -------------------------------------------------------------------------- /// <summary> /// Adds "jump to the next page" button. /// </summary> /// <param name="PagerControls">ControlCollection of the pager</param> /// <param name="enabled">If false, we are already at the last page. /// Adds a simple image control /// </param> // -------------------------------------------------------------------------- private void AddButtonGoToNext(ControlCollection PagerControls, bool enabled) { if (enabled) { LinkButton linkButtonNext = new LinkButton(); linkButtonNext.Text = "következõ >"; linkButtonNext.ID = "GotoNext"; linkButtonNext.ToolTip = "Ugrás a következõ lapra"; linkButtonNext.CausesValidation = false; linkButtonNext.Click += new EventHandler(GoToNextPage); linkButtonNext.Style.Add("padding-left", "3px"); linkButtonNext.Style.Add("padding-right", "3px"); PagerControls.Add(linkButtonNext); } else { Label labelNext = new Label(); labelNext.Text = "következõ >"; labelNext.CssClass = "Pager"; labelNext.Style.Add("padding-left", "3px"); labelNext.Style.Add("padding-right", "3px"); PagerControls.Add(labelNext); } }
// -------------------------------------------------------------------------- /// <summary> /// Adds "jump to the first page" button. /// </summary> /// <param name="PagerControls">ControlCollection of the pager</param> /// <param name="enabled">If false, we are already at the first page. /// Adds a simple image control /// </param> // -------------------------------------------------------------------------- private void AddButtonGoToFirst(ControlCollection PagerControls, bool enabled) { if (enabled) { LinkButton linkButtonFirst = new LinkButton(); linkButtonFirst.Text = "<<"; linkButtonFirst.ID = "GotoStart"; linkButtonFirst.ToolTip = "Ugrás az elejére"; linkButtonFirst.CausesValidation = false; linkButtonFirst.Click += new EventHandler(GoToFirstPage); linkButtonFirst.Style.Add("padding-left", "3px"); linkButtonFirst.Style.Add("padding-right", "3px"); PagerControls.Add(linkButtonFirst); } else { Label labelFirst = new Label(); labelFirst.Text = "<<"; labelFirst.CssClass = "Pager"; labelFirst.Style.Add("padding-left", "3px"); labelFirst.Style.Add("padding-right", "3px"); PagerControls.Add(labelFirst); } }
protected void loadOpenRequestsReport() { System.Web.UI.ControlCollection pnl = pnlOpenRequests.Controls; string json = ""; if (ViewState["ReportOpenCoordinationRequests"] == null) { using (var webClient = new System.Net.WebClient()) { string url = String.Format(System.Configuration.ConfigurationManager.AppSettings["webServiceRootUrl"] + "ReportOpenCoordinationRequests?callsign={0}&password={1}", creds.Username, creds.Password); json = webClient.DownloadString(url); ViewState["ReportOpenCoordinationRequests"] = json; } } else { json = ViewState["ReportOpenCoordinationRequests"].ToString(); } dynamic data = JsonConvert.DeserializeObject <dynamic>(json); Table table = new Table(); if ((data.Report != null) && (data.Report.Data != null)) { foreach (dynamic item in data.Report.Data) { dynamic request = item.Request; using (TableRow headerRow = new TableRow()) { headerRow.AddCell("ID", "requestHeader"); headerRow.AddCell("Requested on"); headerRow.AddCell("Requested by"); headerRow.AddCell("Latitude"); headerRow.AddCell("Longitude"); headerRow.AddCell("Transmit frequency"); headerRow.CssClass = "requestHeader"; table.Rows.Add(headerRow); } using (TableRow row = new TableRow()) { row.AddCell((string)request.ID); row.AddCell((string)request.RequestedDate); row.AddCell((string)request.RequestedBy); row.AddCell((string)request.Latitude); row.AddCell((string)request.Longitude); row.AddCell((string)request.OutputFrequency); row.CssClass = "requestDetails"; table.Rows.Add(row); } using (TableRow row = new TableRow()) { row.AddCell("Workflows", 6); row.CssClass = "workflowDivider"; table.Rows.Add(row); } using (TableRow headerRow = new TableRow()) { headerRow.AddCell(" "); headerRow.AddCell("State"); headerRow.AddCell("Status"); headerRow.AddCell("Time stamp"); headerRow.AddCell("Last reminder"); headerRow.AddCell("Note"); headerRow.CssClass = "workflowHeader"; table.Rows.Add(headerRow); } foreach (dynamic thing in request.Workflows) { dynamic workflow = thing.Workflow; using (TableRow row = new TableRow()) { row.AddCell((string)" "); row.AddCell((string)workflow.State); row.AddCell((string)workflow.Status); row.AddCell((string)workflow.TimeStamp); row.AddCell((string)workflow.LastReminderSent); row.AddCell((string)workflow.Note); row.CssClass = "workflowDetails"; table.Rows.Add(row); } } using (TableRow row = new TableRow()) { row.AddCell("Workflows", 6); row.CssClass = "workflowDivider"; table.Rows.Add(row); } } pnl.Add(table); } else { Label label = new Label(); label.Text = "There are no coordination requests currently open."; pnl.Add(label); } }
private void AddTemplateTo(Control target, ControlCollection owner, ITemplate source, bool addErrorTemplate) { if (target == null) throw new ArgumentNullException("target"); if (owner == null) throw new ArgumentNullException("owner"); if (source == null) throw new ArgumentNullException("source"); source.InstantiateIn(target); owner.Add(target); if (addErrorTemplate) InstantiateErrorTemplate(); }
/// <summary> /// Harvest a collection of controls from DataGrid /// </summary> /// <param name="e"></param> /// <returns>A control collection for DataGrid</returns> public virtual ControlCollection GetControls(DataGridCommandEventArgs e) { DataGrid grid = Grid; ControlCollection controls = new ControlCollection(grid); foreach (TableCell t in e.Item.Cells) { for (int i = 0; i < t.Controls.Count; i++) controls.Add(t.Controls[i]); } return controls; }
public static void SetBookmarkingNavigation(ControlCollection c) { c.Add(GetBookmarkingNavigation()); }
Table CreateTable(ControlCollection controls) { var table = new Table(); table.Style["display"] = DisplayStyle; controls.Add(table); table.BorderWidth = 0; table.CellPadding = 5; table.CellSpacing = 0; return table; }
protected void loadMostWanted() { //lblMostWanted.Text = "<h3>10 most wanted</h3>"; System.Web.UI.ControlCollection pnl = pnlMostWanted.Controls; string json = ""; using (var webClient = new System.Net.WebClient()) { string url = String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings["webServiceRootUrl"], "ReportExpiredRepeaters"); json = webClient.DownloadString(url); ViewState["expiredRepeaters"] = json; } dynamic data = JsonConvert.DeserializeObject <dynamic>(json); if (data.Report != null) { Label lbl = new Label(); lbl.Text = string.Format("<h3>{0}</h3><p>These repeaters have expired their coordination. If you know anything that may lead to the <del>arrest and conviction</del> updating of this record, please contact us or the repeater owner.", data.Report.Title); pnl.Add(lbl); Table table = new Table(); using (TableRow headerRow = new TableRow()) { headerRow.AddCell("Expired"); headerRow.AddCell("Repeater"); headerRow.AddCell("City"); headerRow.AddCell("Sponsor"); headerRow.AddCell("Trustee"); headerRow.CssClass = "expiredRepeaterHeader"; table.Rows.Add(headerRow); } if (data.Report.Data != null) { foreach (dynamic item in data.Report.Data) { dynamic repeater = item.Repeater; using (TableRow row = new TableRow()) { row.AddCell((string)repeater.YearsExpired + " yrs"); row.AddCell(string.Format("<a target='_blank' title='Details' href='/repeaters/details/?id={0}'>{1}<br>{2}</a>", (string)repeater.ID, (string)repeater.Output, (string)repeater.Callsign)); row.AddCell((string)repeater.City); row.AddCell((string)repeater.Sponsor); row.AddCell(string.Format("<a target='_blank' title='QRZ' href='https://qrz.com/db/{0}'>{1}</a>", (string)repeater.Trustee.Callsign, (string)repeater.Trustee.Name)); row.CssClass = "expiredRepeaterData"; table.Rows.Add(row); } } } else { using (TableRow row = new TableRow()) { row.AddCell("None! We're all current! Yay!", 5); row.CssClass = "expiredRepeaterData"; table.Rows.Add(row); } } pnl.Add(table); } }
protected override void CreateFilterCtrl(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content) { content.Add( new HtmlCtrl.DIV() { CssStyleBld = new css.StyleBuilder() { Position = css.Position.Relative, Width = css.Length.Percent(100) }, Content = new Control[] { // Button: Beginns Zeitintervall zurücksetzen new HtmlCtrl.Button("btn" + ColName + "ResetStart") { CssStyleBld = new css.StyleBuilder() { TextAlign = css.TextAlign.Left, Width = css.Length.Pixel(15), PaddingLeft = css.Length.Pixel(2), PaddingRight = css.Length.Pixel(2) }, Text = "[", SetClick = new EventHandler(btnResetVon_Click) }, //// Zahlenbox Von //new HtmlCtrl.DateBox("dbx" + ColName + "FltBegin"){ // CssStyleBld = new css.StyleBuilder() { // Width = new css.LengthMeasurePixel {Value = 70} // }, // SetLoad = new EventHandler(_tbxBegin_Load), // SetTextChanged = new EventHandler(_tbxBegin_TextChanged) //}, new HtmlCtrl.BR(), // Button: Ende Zeitintervall zurücksetzen new HtmlCtrl.Button("btn" + ColName + "ResetEnd") { CssStyleBld = new css.StyleBuilder() { TextAlign = css.TextAlign.Right, Width = css.Length.Pixel(15), PaddingLeft = css.Length.Pixel(2), PaddingRight = css.Length.Pixel(2) }, Text = "]", SetClick = new EventHandler(btnResetBis_Click) }, //// Datumsbox End Zeitintervall //new HtmlCtrl.DateBox("dbx" + ColName + "FltEnd"){ // CssStyleBld = new css.StyleBuilder() { // Width = new css.LengthMeasurePixel {Value = 70} // }, // SetLoad = new EventHandler(_tbxEnd_Load), // SetTextChanged = new EventHandler(_tbxEnd_TextChanged) //} } } ); }
/// <summary> /// Adds the control. /// </summary> /// <param name="controls">The controls.</param> /// <param name="value">The value.</param> /// <param name="validationGroup">The validation group.</param> /// <param name="setValue">if set to <c>true</c> [set value].</param> /// <param name="setId">if set to <c>true</c> [set id].</param> public void AddControl( ControlCollection controls, string value, string validationGroup, bool setValue, bool setId) { Control attributeControl = this.FieldType.Field.EditControl( QualifierValues, setId ? string.Format( "attribute_field_{0}", this.Id ) : string.Empty ); if ( setId ) { attributeControl.ClientIDMode = ClientIDMode.AutoID; } // If the control is a RockControl var rockControl = attributeControl as IRockControl; if ( rockControl != null ) { controls.Add( attributeControl ); rockControl.Label = this.Name; rockControl.Help = this.Description; rockControl.Required = this.IsRequired; rockControl.ValidationGroup = validationGroup; } else { bool renderLabel = ( !string.IsNullOrEmpty( Name ) ); bool renderHelp = ( !string.IsNullOrWhiteSpace(Description)); if ( renderLabel || renderHelp ) { HtmlGenericControl div = new HtmlGenericControl( "div" ); controls.Add( div ); div.Controls.Clear(); div.AddCssClass( "form-group" ); if ( this.IsRequired ) { div.AddCssClass( "required" ); } div.ClientIDMode = ClientIDMode.AutoID; if ( renderLabel ) { Label label = new Label(); div.Controls.Add( label ); label.ClientIDMode = ClientIDMode.AutoID; label.Text = this.Name; label.AssociatedControlID = attributeControl.ID; } if ( renderHelp ) { var HelpBlock = new Rock.Web.UI.Controls.HelpBlock(); div.Controls.Add( HelpBlock ); HelpBlock.ClientIDMode = ClientIDMode.AutoID; HelpBlock.Text = this.Description; } div.Controls.Add( attributeControl ); } else { controls.Add( attributeControl ); } } if ( setValue ) { this.FieldType.Field.SetEditValue( attributeControl, QualifierValues, value ); } }
/// <summary> /// Generates a selection control (Radio, checkbox) and adds /// it to the container /// </summary> /// <param name="container"></param> /// <returns>true if a selection control was added</returns> protected bool GenerateSelectionControl(ControlCollection container) { if (this.SelectionMode == AnswerSelectionMode.Radio) { SelectionRadioButton child = new SelectionRadioButton(); child.GroupName = string.Format("{0}:{1}{2}", this._uniqueGroupId, GlobalConfig.GroupName, this.QuestionId); child.Checked = this.Selected; container.Add(child); if (this.ShowAnswerText) { if ((this.ImageUrl != null) && (this.ImageUrl.Length != 0)) { Image image = new Image(); image.ImageUrl = this.ImageUrl; image.ImageAlign = ImageAlign.Middle; image.ToolTip = this.Text; container.Add(image); } else { child.Text = this.Text;//JJ child.CssClass = "AnswerTextRender"; } } this.SelectionControl = child; } else if (this.SelectionMode == AnswerSelectionMode.CheckBox) { SelectionCheckBox box = new SelectionCheckBox(); box.Checked = this.Selected; container.Add(box); if (this.ShowAnswerText) { if ((this.ImageUrl != null) && (this.ImageUrl.Length != 0)) { Image image2 = new Image(); image2.ImageUrl = this.ImageUrl; image2.ImageAlign = ImageAlign.Middle; image2.ToolTip = this.Text; container.Add(image2); } else { box.Text = this.Text;//JJ box.CssClass = "AnswerTextRender"; } } this.SelectionControl = box; } else if (this.SelectionMode == AnswerSelectionMode.ListItem) { AnswerListItem item = new AnswerListItem(); item.Text = this.Text;//JJ item.CssClass = "AnswerTextRender"; container.Add(item); } else if ((this.ImageUrl != null) && (this.ImageUrl.Length != 0)) { Image image3 = new Image(); image3.ImageUrl = this.ImageUrl; image3.ImageAlign = ImageAlign.Middle; image3.ToolTip = this.Text; container.Add(image3); } else { Literal literal = new Literal(); literal.Text = this.Text; container.Add(literal); } return (this.SelectionControl != null); }