customcontrol

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.UI.WebControls; using System.Drawing; namespace MyCustomControl { public class MyCustom : WebControl { public string Caption { get; set; } public Color MyColor { get; set; } protected override void CreateChildControls() { Controls.Clear(); Label l1 = new Label(); l1.Text = Caption; l1.BackColor = MyColor; Label l2 = new Label(); l2.Text = "Content: " + Caption + " againi"; l2.ForeColor = MyColor; Controls.Add(l1); Controls.Add(l2); } } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.