Hi all, I've got some questions about inheritating from existing WebControls. The questions may sound stupid to expert like you, but it really causing many dizzy circles in my head. Please kindly give me a hand

First off, I have created a very simple webcontrol, which inherits from WebControls.Label.

VB Code:
  1. Public Class MyInheritedLabel
  2.     Inherits System.Web.UI.WebControls.Label
  3.  
  4.     Private m_MyPrefix As String
  5.  
  6.     <Bindable(True), _
  7.     DefaultValue("Any Prefix"), _
  8.     PersistenceMode(PersistenceMode.InnerProperty), _
  9.     DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
  10.     Public Property MyPrefix() As String
  11.         Get
  12.             Return m_MyPrefix
  13.         End Get
  14.         Set(ByVal Value As String)
  15.             m_MyPrefix = Value
  16.         End Set
  17.     End Property
  18.  
  19.     Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
  20.         writer.InnerWriter.Write(m_MyPrefix & Text)
  21.     End Sub
  22. End Class

Everything goes fine, I did successfully compiled it and add them to my toolbox

However, when I use the MyInheritedLabel in another project, I found a strange behaviour. Like usual, I drag the control to my webform and assign some values to the MyPrefix property (though the property window, not from the code). Pressed F5 and have the expected result correctly. However, when I close the form (and save it to disk, of course ) in the VS IDE and then open it again, all the newly assigned value of MyPrefix were gone! ah.. I was expecting the value to be persistable, just like other properties we've got in a normal WebControls.Label. Wouldn't it be wierd to have all the [Text] in WebControls.Label cleared everytime you open the webform in IDE?

So I think it is reasonable to expect the same behaviour from the custom properties i added (in this case, the MyPrefix property). I've did a lot of searching, but never have a clue found. So, I'll be glad to have some information or clue from you guys. Many thanks!!

My 2nd question is somehow embrassing As you've seen, I've put DefaultValue("Any Prefix") before the property declaration. However the default value didn't shown up in the property window. Again, please give me a hand if you got any hints.

Thanks in advance