![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I'm building a custom control and I have an issue. My custom control has a (Server) TextBox control in it and my custom contol exposes a property named Text. I want my Text property displayed within my TextBox (So I basically set TextBox.Text property = Text (that is custom control's Text property) in my CreateChildControls method. But in design mode when I set my (custom control's) Text property the change is not reflected to Text property of my TextBox. What is the most efficient way to achieve this? (I guess calling EnsureChildControls in custom control's Text property set accessor is not a very good idea and sometimes it works sometimes not.) |
|
protected override void CreateChildControls() { base.CreateChildControls(); TextBox textBox = new TextBox(); textBox.ID = "myTextBox"; textBox.Text = this.Text; this.Controls.Add(textBox); this.ChildControlsCreated = true; } |
#3
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |