![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
| "Iain" wrote: I've a complicated custom control which has been running fine for a year or so. Just recently I've made a change which has stopped it working. But why? Well, I've discovered the problem and regard it as a bug. I had a Debug.WriteLine in my code which printed the value of the ClientID. This debug line is called BEFORE the container is added to the controls collection (and hence before it gets it's own ID). So it would appear that if you access ClientID before the container is added to the control tree, the value is fixed at that. If you later add this control to a control collection, the new hierarchy is not reflected in the ClientID. Needless to say I did not expect this. I would have expected the ClientID to be updated if the environment which the control lived in (ie it was parented or reparented) was changed. Of course, the whole thing *still* doesn't work, but that's another story! Moral of the story is - if things don't work take out your debugging code .. Oh if anyone from MS reads this, could you comment on if this should be a bug or not and address it in future releases? Thanks to all for input. Iain |
#2
| |||
| |||
|
|
I would have expected the cached value to be reset if the control was added to a Naming Container. However, without seeing the MS code it's hard to know why they've chosen this behaviour. |
#3
| |||
| |||
|
|
I would have expected the cached value to be reset if the control was added to a Naming Container. However, without seeing the MS code it's hard to know why they've chosen this behaviour. This is indeed the behaviour. I know it. |
#4
| |||
| |||
|
| "Gaurav Vaish (MasterGaurav)" wrote: I would have expected the cached value to be reset if the control was added to a Naming Container. However, without seeing the MS code it's hard to know why they've chosen this behaviour. This is indeed the behaviour. I know it. I just don't like it! Iain |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |