Nested propertiies not set at design time from properties window
- From: "Gery D. Dorazio" <gdorazio@xxxxxxxxx>
- Date: Fri, 2 Mar 2007 04:00:29 -0500
Guess my other post was too long. Maybe this is more to the point.
Here is a composite control...can't get much simpler:
[ToolboxData("<{0}:TestControl runat=\"server\"></{0}:TestControl>")]
public class TestControl : CompositeControl
{
private TextBox tb = new TextBox();
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
NotifyParentProperty(true)]
public TextBox TextBox
{
get { return tb; }
set { tb = value; }
}
protected override void CreateChildControls()
{
base.CreateChildControls();
this.TextBox.ID = "TB1";
this.Controls.Add(TextBox);
}
}
In an aspx page this can then be done:
<ewc:TestControl ID="TestControl1" runat="server" >
<TextBox Height="55"></TextBox>
</ewc:TestControl>
When switching to design mode and expanding the "TextBox" property the
height shows up properly. If I try to change the value from the properties
window it won't set it in the html. It stays at 55 when switching to html
mode. Then when switching back to design mode it shows up as 55, the
original value. In fact this behavior happens for all of the "TextBox"
properties. None of its properties can be set from the properties window.
What's wrong with this?
Does anyone have a solution?
Thanks,
Gery
.
- Prev by Date: Re: AddParsedSubObject and Multiple Identical Property Types
- Next by Date: Decorating Derived Page Classes with Custom Attributes
- Previous by thread: Re: AddParsedSubObject and Multiple Identical Property Types
- Next by thread: Decorating Derived Page Classes with Custom Attributes
- Index(es):
Relevant Pages
|
Loading