VB version
Imports System.Web.UI
Namespace ServerControls
<Themeable(False)> _
Public Class SimpleHello
Inherits System.Web.UI.Control
Private _name As String
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal Value As String)
_name = Value
End Set
End Property
Protected Overrides Sub Render(ByVal controlOutput As _
HtmlTextWriter)
controlOutput.Write("Hello " + Name)
End Sub
End Class
End Namespace
C# version
using System.Web.UI;
namespace ServerControls
{
[Themeable(false)]
public class SimpleHello : Control
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
protected override void Render(HtmlTextWriter controlOutput)
{
controlOutput.Write ("Hello " + Name);
}
}
}
|