A
Andrew Backer
I have pretty simple composite control consisting of a textbox and
image control. On the composite control I have defined my own
'Enabled' property which simply calls into the sub-controls and sets
their Enabled property. I am inheriting from Web.UI.Control, not
WebControls.Control.
The problem is that, after the first time I set it, I can not 'un-set'
it. It appears that I can call the .Enabled method and it does
everything right, but at the very last moment something else overrides
me. The call statck looks something like this :
Page Event Handler (click)
... this.compControl.Enabled = true; // was false
... CompControl::CreateChildControls() - _text.Enabled is 'true'
... CompControl::OnPreRender() - _text.Enabled is 'true'
Where do I need to put this call in order to get this to stick? I have
gotten the image to work by turning off viewstate for it, but I don't
understand whats going on! My trace looks like this :
aspx.page End ProcessPostData Second Try
aspx.page Begin Raise ChangedEvents
..Enabling Controls-------------
aspx.page End Raise ChangedEvents
aspx.page Begin Raise PostBackEvent
aspx.page End Raise PostBackEvent
aspx.page Begin PreRender
..Enabling Controls-------------
...DateTextbox::CreateChildControls()
....._textbox.enabled : True
....._picker.enabled : True
...DateTextBox::OnPreRender()
....._textbox.Enabled = False
....._picker.Enabled = True
.........DatePicker::OnPreRender() : True
Thanks for any help,
Andrew Backer
image control. On the composite control I have defined my own
'Enabled' property which simply calls into the sub-controls and sets
their Enabled property. I am inheriting from Web.UI.Control, not
WebControls.Control.
The problem is that, after the first time I set it, I can not 'un-set'
it. It appears that I can call the .Enabled method and it does
everything right, but at the very last moment something else overrides
me. The call statck looks something like this :
Page Event Handler (click)
... this.compControl.Enabled = true; // was false
... CompControl::CreateChildControls() - _text.Enabled is 'true'
... CompControl::OnPreRender() - _text.Enabled is 'true'
Where do I need to put this call in order to get this to stick? I have
gotten the image to work by turning off viewstate for it, but I don't
understand whats going on! My trace looks like this :
aspx.page End ProcessPostData Second Try
aspx.page Begin Raise ChangedEvents
..Enabling Controls-------------
aspx.page End Raise ChangedEvents
aspx.page Begin Raise PostBackEvent
aspx.page End Raise PostBackEvent
aspx.page Begin PreRender
..Enabling Controls-------------
...DateTextbox::CreateChildControls()
....._textbox.enabled : True
....._picker.enabled : True
...DateTextBox::OnPreRender()
....._textbox.Enabled = False
....._picker.Enabled = True
.........DatePicker::OnPreRender() : True
Thanks for any help,
Andrew Backer