America/US Samples
Europe Samples
Asia Samples

Gaia Ajax: BrowserHistory

The BrowserHistory Control allows you to add states to your application by using the AddHistory function. When the user clicks back in the browser, the state info will be passed to the server in the Navigated event. This is an Ajax request where you can restore the state of your application based on this information.

Please select your favorite Comedian




Markup (ASPX/.aspx)

   1:   
   2:   
   3:  <gaia:BrowserHistory 
   4:      id="zHistory" 
   5:      runat="server" 
   6:      OnNavigated="zHistory_Navigated">
   7:  </gaia:BrowserHistory>
   8:   
   9:   <p>Please select your favorite Comedian</p>
  10:   <gaia:DropDownList 
  11:          ID="zComedian" 
  12:          runat="server" 
  13:          AutoPostBack="true" 
  14:          OnSelectedIndexChanged="zComedian_SelectedIndexChanged">
  15:          <Items>
  16:              <asp:ListItem Value="jerry">Jerry Seinfeld</asp:ListItem>
  17:              <asp:ListItem Value="rowan">Rowan Atkinson</asp:ListItem>
  18:              <asp:ListItem Value="dave">Dave Chappelle</asp:ListItem>
  19:              <asp:ListItem Value="sacha">Sacha Baron Cohen</asp:ListItem>
  20:              <asp:ListItem Value="al">"Weird Al" Yankovic</asp:ListItem>
  21:              <asp:ListItem Value="chong">Cheech and Chong</asp:ListItem>
  22:          </Items>
  23:      </gaia:DropDownList>
  24:      
  25:      <br /><br />
  26:   <gaia:Label Visible="false" ID="zInfo" runat="server">
  27:   Wonderful! You have changed the selection in the dropdownlist, now try 
  28:   the back button in the browser to restore to the previous state. 
  29:   </gaia:Label>
  30:   
  31: