Imports Microsoft.VisualBasic
Imports System.Web.UI.WebControls

Namespace MikesControls
    Public Class MyControl1
        Inherits WebControl

        Public Sub New()
            ' Do Nothing
            ' Warning: The constructor gets called before the Property values
            ' are read and set.
            '
        End Sub

        Protected Overrides Sub RenderContents(ByVal writer As System.Web.UI.HtmlTextWriter)

            ' Apply attributes and CSS style attributes to the 
            ' next tag opened using BeginTag
            '
            writer.AddAttribute(HtmlTextWriterAttribute.Id, "myspan")
            writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "red")

            writer.RenderBeginTag(HtmlTextWriterTag.Span)   ' Open Span tag
            writer.Write("Hello")                           ' Tags & text
            writer.RenderEndTag()                           ' Close Span tag
        End Sub


    End Class
End Namespace

