Simple custom control
Using System;
Using System. Web. UI;
Using System. Web. UI. webcontrols;
Using System. componentmodel;
Namespace Simplecontrol
{
/**/ /// <Summary>
///Abstract description of webcustomcontrol1.
/// </Summary>
[Defaultproperty ( " Text " ),
Toolboxdata ( " <{0}: webcustomcontrol1 runat = Server> </{0}: webcustomcontrol1> " )]
Public Class Webcustomcontrol1: system. Web. UI. webcontrols. webcontrol
{
Private String Text;
// Attribute Bindable specifies whether a property is usually used for binding
// CATEGORY specifies the category of the attribute or event that will be displayed in the visualization designer
// Defalutvalue is used to specify the default value of an attribute.
[Bindable ( True ),
Category ( " Appearance " ),
Defaultvalue ( "" )]
Public String Text
{
Get
{
ReturnText;
}
Set
{
Text=Value;
}
}
/**/ /// <Summary>
///This control is displayed to the specified output parameter.
/// </Summary>
/// <Param name = "output">HTML writer to write</Param>
Protected Override Void Render (htmltextwriter output)
{
Output. Write ("<Span>"+Text+"</Span>");
}
}
}