America/US Samples
Europe Samples
Asia Samples

State Managers: Serialization

Gaia Ajax detects property changes during ajax callbacks and serializes changes back to the client. In this example 25 nested labels are rendered and the backColor style is serialized for that element on the OnClick event. The key point behind this sample is to demonstrate that basic ajax re-rendering is flawfull in that it would generate too much response for the simple change of a property.

Which rendering strategy would you prefer


Click on any of the Boxes

With 40 nested labels, the partial rendering strategy delivers around 8.5KB of data, while the simple serialization of the property takes around 512 bytes. Partial rendering then occupies approx 16X more bandwidth in this simple case. Imagine a more complex page?


Don't believe it? Download Firebug or Fiddler and see for yourself

Markup (ASPX/.aspx)

   1:   
   2:      <p> Which rendering strategy would you prefer</p>
   3:      <gaia:RadioButtonList ID="zRenderOption" runat="server">
   4:          <Items>
   5:              <asp:ListItem Value="0" Text="Partial Rendering"></asp:ListItem>
   6:              <asp:ListItem Selected="True" Value="1" Text="Gaia StateManagers"></asp:ListItem>
   7:          </Items>
   8:      </gaia:RadioButtonList>
   9:      <h2>Click on any of the Boxes</h2>
  10:      <gaia:Panel id="zRoot" runat="server" CssClass="root-panel"></gaia:Panel>
  11:      
  12:      <p style="color: #a05;">With 40 nested labels, the partial rendering strategy delivers around
  13:      <b>8.5KB of data</b>, while the simple serialization of the property takes around 512 bytes. Partial rendering
  14:      then occupies approx <b><u>16X</u></b> more bandwidth in this simple case. Imagine a more complex page?  
  15:      </p>
  16:      <br />
  17:      <i>Don't believe it? Download <a href="http://getfirebug.com/" title="FireBug">Firebug</a> or <a href="http://www.fiddler2.com/fiddler2/" title="Fiddler">Fiddler</a>  and see for yourself</i>
  18: