Nested propertiies not set at design time from properties window

  • Thread starter Gery D. Dorazio
  • Start date
G

Gery D. Dorazio

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top