views:

5

answers:

1

Hi I am hoping for some help.

I have created a composite control that has some basically functions. I would like to be able to take that composite control and reuse the code.

How do I do this? I have created a class and inheriated from my cc

public class PasswordTextBox : RoundedTextBox

now if I add another property to the new cc everything is over however nothing is rendered on the page.

What extra steps do I need to do?

A: 

Are you sure you've called the base class's render method? Is your RoundedTextBox inheriting from System.Web.UI.Control or System.Web.UI.WebControls.WebControl? I'm presuming it's inheriting from the latter since that's what TextBox derives from.

Protected virtual void RenderContents(HtmlTextWriter Writer)
{
      Base.Render(Writer);
}

Take a look at this link and see if it helps: http://www.aspfree.com/c/a/ASP.NET/ASPNET-Custom-Server-Controls-Breaking-the-Secrets-of-Rendering/3/

Ritik Khatwani