America/US Samples
Europe Samples
Asia Samples

Gaia Ajax: BrowserHistory with Dynamic User Controls

This example turns out to be quite useful in application development. All the nitty gritty details of loading dynamic usercontrols, keeping state for the back/forward buttons in the browser is abstracted away in the DynamicUserControl classes.


As an extra bonus you also get a clean API for navigating between the different usercontrols.

Step 1

This is the first dynamically loaded user control. Notice how the location url has been changed to indicate #step1. Now click the button to advance to Step2.


Markup (ASPX/.aspx)

   1:   
   2:  <samples:DynamicUserControl ID="zHost" runat="server" SelectedEntryIndex="0">
   3:    <DynamicUserControls>
   4:        <samples:DynamicUserControlEntry Token="step1" UserControlPath="~/Core/BrowserHistory/DynamicUserControls/Step1.ascx" />
   5:        <samples:DynamicUserControlEntry Token="step2" UserControlPath="~/Core/BrowserHistory/DynamicUserControls/Step2.ascx" />
   6:        <samples:DynamicUserControlEntry Token="step3" UserControlPath="~/Core/BrowserHistory/DynamicUserControls/Step3.ascx" />
   7:        <samples:DynamicUserControlEntry Token="step4" UserControlPath="~/Core/BrowserHistory/DynamicUserControls/Step4.ascx" />
   8:    </DynamicUserControls>
   9:  </samples:DynamicUserControl>
  10: