<%@ Page Language="C#" %>

<%@ Register Assembly="nStuff.UpdateControls" TagPrefix="nk" Namespace="nStuff.UpdateControls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  protected void stepChanged(object sender, EventArgs e)
  {
    UpdateHistory1.AddEntry(((Wizard)sender).ActiveStepIndex.ToString());
  }

  protected void historyNavigate(object sender, HistoryEventArgs e)
  {
    int step = 0;
    if (e.EntryName != null)
    {
      int.TryParse(e.EntryName.ToString(), out step);
    }
    if (step >= 0 && step < Wizard1.WizardSteps.Count)
    {
      Wizard1.ActiveStepIndex = step;
    }
    UpdatePanel1.Update();
  }
  
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>ASP.NET AJAX</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <nk:UpdateHistory ID="UpdateHistory1" runat="server" OnNavigate="historyNavigate" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
      <ContentTemplate>
        <asp:Wizard ID="Wizard1" runat="server" OnActiveStepChanged="stepChanged" 
              FinishCompleteButtonText="Koniec" FinishPreviousButtonText="Wstecz" 
              StartNextButtonText="Dalej" StepNextButtonText="Dalej" 
              StepPreviousButtonText="Wstecz">
          <WizardSteps>
            <asp:WizardStep runat="server" Title="Etap 1.">
              <h1>Do startu...</h1>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Etap 2.">
              <h1>Gotowi...</h1>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Etap 3.">
              <h1>Start!</h1>
            </asp:WizardStep>
          </WizardSteps>
        </asp:Wizard>
      </ContentTemplate>
    </asp:UpdatePanel>
    <div>
    </div>
  </form>
</body>
</html>
