Adding a Designer attribute to a control class (C#) : Designer attribute « Custom Controls « ASP.NET Tutorial






using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebControlLibrary1
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:WebCustomControl1 runat=server></{0}:WebCustomControl1>")]
    [Designer(typeof(ControlDesigner))]
    public class WebCustomControl1 : WebControl
    {
        private string text;

        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue("")]
        public string Text
        {
            get
            {
                return text;
            }
            set
            {
                text = value;
            }
        }

        protected override void Render(HtmlTextWriter output)
        {
            output.RenderBeginTag(HtmlTextWriterTag.Input);
            output.RenderEndTag();
        }
    }
}








14.7.Designer attribute
14.7.1.Adding a Designer attribute to a control class (C#)
14.7.2.Adding a Designer attribute to a control class (VB)