Ive written a custom textbox control which adds a simple asterisk after a textbox field:<BR><BR>[code language="vbscript"]<BR>Public Class TextBox<BR> Inherits WebControls.TextBox<BR> <BR> Private _MandatoryClassName As String<BR><BR> &#039;constructor for design-mode textboxes<BR> Public Sub New()<BR> MyBase.New()<BR> _MandatoryClassName = ""<BR> End Sub<BR><BR> &#039;constructor for runtime textboxes<BR> Public Sub New(ByVal sMandatoryClassName As String)<BR> MyBase.New()<BR> _MandatoryClassName = sMandatoryClassName<BR> End Sub<BR> <BR> Public Property MandatoryClassName() As String<BR> Get<BR> Return _MandatoryClassName<BR> End Get<BR> Set(ByVal sMandatoryClassName As String)<BR> _MandatoryClassName = sMandatoryClassName<BR> End Set<BR> End Property<BR><BR> Protected Overrides Sub Render(writer As HtmlTextWriter)<BR> MyBase.Render(writer)<BR> writer.Write("&#060;span class=""" & _MandatoryClassName & """&#062;*&#060;/span&#062;")<BR> End Sub<BR> End Class<BR>[/code]<BR><BR>The problem is that at runtime I want to swap a normal textbox control for one of these - to go with my current dynamic validation code.<BR><BR>I could go through the whole site and replace every textbox with a new control which can display an asterisk or not, but it would much easier if i code do something like this:<BR><BR>[code language="vbscript"]<BR>&#039;normal asp.net textbox control called &#039;text&#039;<BR>&#039;replace normal textbox class with child class<BR>text = New MyWeb.FormControls.TextBox("warning")<BR>[/code]<BR><BR>I would assume that this code would replace the asp.net textbox control with my sub-class - and then use the overriden Render() method of the new class. This is not the case however - the render method is never called.<BR><BR>Any ideas where to go from here?<BR>Thanks in advance.<BR><BR>mafro