Difference between Update(), UpdateContent() and Render()

  1. #1

    Difference between Update(), UpdateContent() and Render()

    Hello,

    while starting to develop a site based on ext.net (I am still a newbie), I ran into troubles with updating panels or containers within ajax directmethods.
    For that I would ask if anyone knows the exact differences, resp. definitions of
    - Update()
    - UpdateContent()
    - Render()

    When should each method be used? What does it exactly do?
    Is there any kind of documentation, be it a source code documentation?

    Thanks for your help,
    regards,
    bright
  2. #2
    Hi,

    1. The .Update() method.

    Ext.NET controls:

    Please see the ExtJS docs article:
    http://docs.sencha.com/ext-js/3-4/#!...-method-update

    Our .Update() method is just a wrapper.

    So, you should use .Update() if need to update a component with a new HTML.

    Non Ext.NET controls (for example, native ASP.NET ones).

    This is an extension method to update the controls during a DirectEvent/DirectMethod.

    2. The .Render() method.

    Please use .Render() when you need to render a new widget or re-render an existing widget.

    For example, you create a GridPanel during DirectEvent.

    Example
    GridPanel grid = new GridPanel();
    ...
    SomeExtNetContainer.Items.Add(grid);
    grid.Render();
    3. The UpdateContent() method.

    Please use .UpdateContent() when you need to update container's content.

    For example, if you add a user control into a .ContentControls collection, you can call .UpdateContent() for that container, at that a top level control of a user control should not be a layout control. If it's a layout control, please call .Render() for the container.

    Example
    UserControl uc = (MyUserControl)LoadControl(MyUserControl.uc);
    SomeExtNetContainer.ContentControls.Add(uc);
    SomeExtNetContainer.UpdateContent();
    If a top level control of a user control is a layout one, it should look like this:

    Example
    UserControl uc = (MyUserControl)LoadControl(MyUserControl.uc);
    SomeExtNetContainer.ContentControls.Add(uc);
    SomeExtNetContainer.Render();
    As well, please don't use .Render() and .UpdateContent() of Viewport. If you need to update a Viewport's content, please set up an intermediate container.
    Last edited by Daniil; Sep 17, 2012 at 9:36 AM.

Similar Threads

  1. UpdateContent() problem.
    By berger in forum 1.x Help
    Replies: 5
    Last Post: Aug 01, 2012, 6:41 PM
  2. [CLOSED] Toggle Render? Refresh Render?
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 08, 2011, 3:13 PM
  3. [CLOSED] Viewport1.UpdateContent() does not work
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 16, 2010, 12:41 PM
  4. Alert CSS difference
    By gfcmedia in forum 1.x Help
    Replies: 4
    Last Post: Aug 17, 2010, 9:32 PM
  5. Replies: 3
    Last Post: Jun 23, 2010, 6:18 PM

Tags for this Thread

Posting Permissions