I can honestly say I've never encountered this one before: I have two .ascx files, one of which is nested within th开发者_Python百科e other. It all works the first time I visit the page after a build, but then every subsequent visit / refresh results in an error. The error is caused because the reference to the nested control;
ctrlAdPanels.Title = _productGroupName;
as in, ctrlAdPanels, is apparently no longer instantiated (it's null). Does anyone have any idea why this may be happening? Is it something to do with the order in which nested controls are instantiated and if so, how can I force the nested one to be instantiated first?
Thanks,
-Mikey
Okay I sorted this myself - it's because i was using OutputCache on the nested control for 20 seconds.
精彩评论