[CLOSED] Load control to 1 tab at time

Page 3 of 3 FirstFirst 123
  1. #21
    Also the following can help.

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        btnCreate.SuspendScripting();
        btnCreate.Hidden = true;
        btnCreate.ResumeScripting();
    }
            
    protected override void OnPreRender(EventArgs e)
    {
        base.OnLoad(e);
        btnCreate.SuspendScripting();
        btnCreate.Hidden = false;
        btnCreate.ResumeScripting();
    }
    If a control is designed to be used with Ext.NET and that control is going to be recreated during an Ext.NET AJAX request (DirectEvent or DirectMethod), you should suspend scripting for all property changes during the whole control life cycle starting from "base.onInit(e)" (see the example below). It is aslo actual for a control's child controls (as demonstrated in the example above).

    Example
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        this.SuspendScripting();
        this.Hidden = true;
        this.ResumeScripting();
    }
    "starting from "base.onInit(e)" means that you can initialize the control's (and its chilldren's) properties within a control's constructors or prior to "base.OnInit(e)" call without suspending of scripting.
  2. #22
    Quote Originally Posted by Daniil View Post
    Also the following can help.

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        btnCreate.SuspendScripting();
        btnCreate.Hidden = true;
        btnCreate.ResumeScripting();
    }
            
    protected override void OnPreRender(EventArgs e)
    {
        base.OnLoad(e);
        btnCreate.SuspendScripting();
        btnCreate.Hidden = false;
        btnCreate.ResumeScripting();
    }
    If a control is designed to be used with Ext.NET and that control is going to be recreated during an Ext.NET AJAX request (DirectEvent or DirectMethod), you should suspend scripting for all property changes during the whole control life cycle starting from "base.onInit(e)" (see the example below). It is aslo actual for a control's child controls (as demonstrated in the example above).

    Example
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        this.SuspendScripting();
        this.Hidden = true;
        this.ResumeScripting();
    }
    "starting from "base.onInit(e)" means that you can initialize the control's (and its chilldren's) properties within a control's constructors or prior to "base.OnInit(e)" call without suspending of scripting.
    I've add SuspendScripting() and ResumeScripting() in parent control(which contains button with ID="btnCreate" which generate error) and this not work. I've added at all OnInit,OnLoad,OnPrerender Events of control.

    Ok but don't recreating control if event TabChange occurs work for me;)
    Thanks a lot @Daniil:)

    thread can be closed:)
    Last edited by ViDom; May 29, 2013 at 12:51 PM.
  3. #23
    Quote Originally Posted by ViDom View Post
    I've add SuspendScripting() and ResumeScripting() in parent control(which contains button with ID="btnCreate" which generate error) and this not work. I've added at all OnInit,OnLoad,OnPrerender Events of control.
    Strange, it works for me. If you want to sort it out, please provide a full test case again. If no, we can just close the thread.
Page 3 of 3 FirstFirst 123

Similar Threads

  1. [CLOSED] First Request taking too much time to load page
    By shaileshsakaria in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 06, 2013, 7:56 PM
  2. How can i do learn GridPanel load time
    By fatihunal in forum 1.x Help
    Replies: 2
    Last Post: Feb 01, 2012, 8:09 PM
  3. [CLOSED] performance when the page load first time
    By lonely7345 in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 06, 2011, 6:06 PM
  4. [URGENT] General Page Load time
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Mar 30, 2011, 5:01 AM
  5. Replies: 7
    Last Post: Sep 22, 2010, 8:07 AM

Tags for this Thread

Posting Permissions