Originally Posted by
Daniil
Currently, we have some idea which might make the case working without manual suspending of scripting. Though, we have to test it a bit more. We will update the thread with a final decision.
I want to revisit this above. Can you update me on status?
Moreover, I want to talk more about what it looks like building a reusable user control. It's starting to get pretty cut-n-paste ugly. I'm considering starting to extend Ext.Net again to support some basic logic if it can't be provided.
Let me start at the beginning...
Level 1
I have a basic panel in a user control. Page_Load populate its members. So far so good.
Level 2
Okay, but there are DirectEvents, so for efficiency I skip rendering on posts-back by adding a test at the beginning of Page_Load with X.IsAjaxRequest and return right away. Very basic and we address 2 modes: Page_Load and DirectEvent.
Level 3
At this level I feel like there's limited extnet support. In this scenario, I've got DirectEvents constructing the User Control and rendering needs to be turned back on. I need an exception.
But at present, there's no way to ask Ext.net two questions: "Am I in a post-back?" but also "Do I need to render this control anyway?" It would be nice if I could ask, but as present I have to do something like this manually when I load the UserControl: Context.Items["DirectControlRender"]=true, so that when the user control enters Page_Load I can test (X.IsAjaxRequest && Context.Items["DirectControl"]==null).
But that's not all. Because as we've described earlier, I have to wrap the UserControl loading around turning on and off X.ControlsScripting before calling Panel1.ContentControls.Add( uc ).
The more controls I do this to, the more I'm confident there really are 3 modes. What's the status on all this? I'm hoping for some extension to all this before 2.4. Is that on the roadmap?