views:

20

answers:

0

I've created a custom control that inherits from panel for the purpose of wrapping a drop-shadow around HTML entities.

The creation of the control itself was simple enough, but I'd like to utilize this control up to 100 times on the same page. I'm concerned about the additional viewstate size or other bits of additional overhead that may accompany utilizing a server control many times on the same page.

Is there a standard method for making a custom server control extremely lightweight?

The only thing the control does is analyze attributes for CSS Styling, and then injecting a bit of HTML before and after .InnerHTML

Thanks

Here's the guts of the custom control:

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Controls
    Partial Public Class ShadowPanel
        Inherits Panel

        Public Sub New()
            MyBase.New()
        End Sub

        Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
            writer.Write("top part of drop shadow box")
            MyBase.Render(writer)
            writer.Write("bottom part of drop shadow box")
        End Sub

    End Class
End Namespace

edit: I'm open to the idea of inheriting from a simpler class, such as HtmlContainer if it would help