views:

204

answers:

0

I'm having issues with a custom panel control in design view. Overriding the render method has no affect at design-time.

If I extend a textbox as follows the design time showed the div tag and then the textbox control. Tried the same with the panel control and it did not show the div with the here text in it. Seems since panel is a container control it works differently in design view. Really frustrating. Any ideas on how to get my design-time to render the way I want it to?

Public Class textboxextend
  Inherits TextBox

  Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)

    writer.RenderBeginTag("div")
    writer.Write("here")
    writer.RenderEndTag()
    MyBase.Render(writer)
  End Sub
End Class

Public Class panelextend
  Inherits Panel

  Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)

    writer.RenderBeginTag("div")
    writer.Write("here")
    writer.RenderEndTag()
    MyBase.Render(writer)
  End Sub
End Class