jasonlancester-gmail
-
4/25/2009 11:45:22 PM
Databound controls do not fire events
There have been several instances in a particular application we are currently working on, where we are trying to handle events on databound controls such as a GridView or a ListView that we are manually binding in the code-behind pages and the handlers are never called.
Furthermore, when the postback completes, the control disappears from the page!
I have tried using the debugger, setting breakpoints in the event handlers, performing the action to fire the event... and it never hits the breakpoint. I tried it with and without UpdatePanel controls to see if that was causing an issue, with no difference in the results.
I initially developed and tested these controls in a sandbox project, completely independent of Kentico and everything behaved as expected. Now that the controls are integrated into Kentico, and being plugged into Kentico portal engine pages they exhibit this behavior, with identical code, save for one control that inherits from CMSAbstractWebPart (I know this has nothing to do with it, but I'm trying to emphasize the fact that the code is -identical- in every meaningful way).
I'm in no way new to ASP.NET, I realize there are pitfalls to manually binding databound controls and 'unexpected behavior' if you don't know how ASP.NET works but I am truly at a loss as to what to do about this. I've come up with workarounds but they are burdensome, in terms of both memory overhead and in just implementing and maintaining them while changing things around.
If anyone has heard of this problem before and has a suggestion, any help at this point would be greatly appreciated.
|