S
Sam
I've got:
<ParseChildren(True)> _
Public Class UserElement
Inherits WebControl
Public strLabel As new Label
Public Sub New()
strLabel.id = "myID"
End Sub
<PersistenceMode(PersistenceMode.InnerProperty)> _
Public Property objLabel() As Label
Get
Return Me.strLabel
End Get
Set(ByVal value As Label)
me.strLabel = value
End Set
When calling:
<objLabel runat="server">mySecondLabel</objLabel>
I've noticed that only objLabel.set() gets called.
Which means the <objLabel> creates a "new" Label object.
So when the objLabel.set() gets called my old properties like ID (as set
in New()) get overwritten (with nothing, because not set in the tag).
Is there a way that ASP.NET first calles the objLabel.get() and then
"adds" the properties to this existing object?
The other option would be to copy all the properties by hand which is
quite ugly.
Sam.
<ParseChildren(True)> _
Public Class UserElement
Inherits WebControl
Public strLabel As new Label
Public Sub New()
strLabel.id = "myID"
End Sub
<PersistenceMode(PersistenceMode.InnerProperty)> _
Public Property objLabel() As Label
Get
Return Me.strLabel
End Get
Set(ByVal value As Label)
me.strLabel = value
End Set
When calling:
<objLabel runat="server">mySecondLabel</objLabel>
I've noticed that only objLabel.set() gets called.
Which means the <objLabel> creates a "new" Label object.
So when the objLabel.set() gets called my old properties like ID (as set
in New()) get overwritten (with nothing, because not set in the tag).
Is there a way that ASP.NET first calles the objLabel.get() and then
"adds" the properties to this existing object?
The other option would be to copy all the properties by hand which is
quite ugly.
Sam.