I'm writing an ASP.NET custom composite control (Inherits System.Web.UI.WebControls.CompositeControl).

By default my control mark up renders surrounded by tags. I know I can over ride the property TagKey to set the return as whatever tag I want from the System.Web.UI.HtmlTextWriterTag enum.

My question: Can I make my control render without .NET adding markup around it?

---

UPDATE (3/2/2011) Thanks Swati for your answer. I want to show how I am solving my question now. I think I will integrate some of Swati's ideas. Specifically, AddAttributestoRender(), but I'm wondering if that is needed since the CompositeControl will lack a parent markup tag to hold the attributes.

When I don't want a containing markup tag, then I override one property & two methods from CompositeControl.

```vbnet
Protected Overrides ReadOnly Property TagKey() As System.Web.UI.HtmlTextWriterTag
    Get
        ' System defaults return as HtmlTextWriterTag.Span
        Return HtmlTextWriterTag.Unknown
    End Get
End Property

Public Overrides Sub RenderBeginTag(ByVal writer As System.Web.UI.HtmlTextWriter)
    If Me.TagKey <> HtmlTextWriterTag.Unknown Then
        MyBase.RenderBeginTag(writer)
    End If
End Sub

Public Overrides Sub RenderEndTag(ByVal writer As System.Web.UI.HtmlTextWriter)
    If Me.TagKey <> HtmlTextWriterTag.Unknown Then
        MyBase.RenderBeginTag(writer)
    End If
End Sub

```