Imports System Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls Namespace myControls Public Class Login Inherits Control Implements INamingContainer Public Property Username As String Get Me.EnsureChildControls() Return CType( Controls( 2 ), TextBox ).Text End Get Set Me.EnsureChildControls() CType( Controls( 2 ), TextBox ).Text = Value End Set End Property Public Property Password As String Get Me.EnsureChildControls() Return CType( Controls( 5 ), TextBox ).Text End Get Set Me.EnsureChildControls() CType( Controls( 5 ), TextBox ).Text = Value End Set End Property Protected Overrides Sub CreateChildControls() Me.Controls.Add( New LiteralControl( "
" ) ) ' Add Password Dim txtPass As New TextBox Me.Controls.Add( New LiteralControl( "Password: " ) ) txtPass.TextMode = TextBoxMode.Password Me.Controls.Add( txtPass ) Me.Controls.Add( New LiteralControl( "
" ) ) ' Add Submit Button Dim btnButton As New Button btnButton.Text = "Login!" Me.Controls.Add( btnButton ) Me.Controls.Add( New LiteralControl( "