Try the following. It's not too bad.
For your server side control, create a Property that you can fill with whatever text you want. I called it "ExtraStuff". Support it with a Private variable. Then override the Render to write out your extra stuff as part of the tag:
Public Class Textarea
Inherits System.Web.UI.HtmlControls.HtmlTextArea
Private m_sExtraStuff As String = ""
Public Property ExtraStuff As String
Get
Return m_sExtraStuff
End Get
Set(value As String)
m_sExtraStuff = value
End Set
End Property
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
writer.Write("<textarea ")
writer.Write(m_sExtraStuff)
writer.Write("></textarea>")
End Sub
End Class
Then, in your markup you can add the extra stuff that you want to write out by adding it to the property you created. You'll have to make sure it's encoded properly though:
<me:Textarea runat="server" ExtraStuff=":class="{}" :id="something""></me:Textarea>
When this renders, I think it will look like you want it:
<textarea :class="{}" :id="something"></textarea>
Or:
Another approach that might be more robust is to explicitly declare these special attributes and then write them out in your format. The server side control:
Public Class Textarea
Inherits System.Web.UI.HtmlControls.HtmlTextArea
Private m_sSpecialID As String = ""
Private m_sSpecialClass As String = ""
Public Property SpecialID As String
Get
Return m_sSpecialID
End Get
Set(value As String)
m_sSpecialID = value
End Set
End Property
Public Property SpecialClass As String
Get
Return m_sSpecialClass
End Get
Set(value As String)
m_sSpecialClass = value
End Set
End Property
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
writer.Write("<textarea :class=""")
writer.Write(m_sSpecialClass)
writer.Write(""" :id=""")
writer.Write(m_sSpecialID)
writer.Write("""></textarea>")
End Sub
End Class
The markup:
<me:Textarea runat="server" SpecialClass="{}" SpecialID="something"></me:Textarea>
The output is the same.