Using System;
Using System. Web. UI;
Using System. Web. UI. webcontrols;
Using System. componentmodel;
Namespace Csmathcontrol
{
/// <Summary>
/// Center abstract description.
/// </Summary>
[Defaultproperty ( " Text " ),
Toolboxdata ( " <{0}: center runat = Server> </{0}: center> " )]
[Parsechildren ( False )]
Public Class Center: system. Web. UI. webcontrols. webcontrol, inamingcontainer
{
Private String Text;
[Bindable ( True ),
Category ( " Appearance " ),
Defaultvalue ( "" )]
Public String Text
{
Get
{
Return Text;
}
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 (text );
Output. addattribute ( " Align " , " Center " );
Output. addstyleattribute ( " Background-color " , " Red " );
// Start pannel
Output. renderbegintag ( " Div " );
Foreach (Control ctritem In controls)
{< br> ctritem. rendercontrol (output);
}< br> output. renderendtag ();
}< BR >}< br>