Last post Jan 27, 2010 08:41 PM by kevcpu
Jan 27, 2010 05:51 PM|kevcpu|LINK
Is it possible to tap into a controls prerender event? For example, if I wanted a SPAN tag to appear around a asp:TextBox control. Could I somehow hook an event into the control that would still call the controls prerender, but allowing me the determine
when it gets called?
Jan 27, 2010 08:28 PM|pmourfield|LINK
Sure, jsut create a new class that derives from TextBox and overrides the Render Method. Like this:
Public Class CustomTextBoxRender
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
' Add custom Render code HERE!!!
' Call the base class's Render method.
Jan 27, 2010 08:41 PM|kevcpu|LINK
I really need to do without overriding, on the fly. Is there a way this could be achieved using delegates? In a nutshell, I need to somehow force the control to call a new variation of the render method without removing the current Render method it has
in place. I know this sounds odd, but this would be a tremendous help.