title: Why does my custom ASP.Net control become its base control upon postback?
body: <p>In order to customize the aspect of some nodes in a <code>TreeView</code> control, I've created a custom control derived from the <code>TreeNode</code> class, which overrides the <code>RenderPreText</code> and <code>RenderPostText</code> methods.</p>
  
  <p>This works fine... until the user clicks on anything in the page. As soon as a postback is made, all TreeNodes lose their custom aspect.</p>
  
  <p>I've inspected the code with the debugger, and I've discovered that all the <code>TreeNode</code>s are being created as <code>MyCustomTreeNode</code> objects, but after the postback they just become standard <code>TreeNode</code>s.</p>
  
  <p>What's happening here?!?</p>