zoukankan      html  css  js  c++  java
  • asp.net Ajax 异步刷新时:前进后退按钮可用。

     <asp:ScriptManager ID="ScriptManager1" runat="server" EnableHistory="True" 
            EnableSecureHistoryState="False">
        </asp:ScriptManager>     
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Wizard ID="Wizard1" runat="server"  ActiveStepIndex="0" onactivestepchanged="Wizard1_ActiveStepChanged">
                    <WizardSteps>
                        <asp:WizardStep runat="server" title="Step 1">
                            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                        </asp:WizardStep>
                        <asp:WizardStep runat="server" title="Step 2">
                            Step 2</asp:WizardStep>
                        <asp:WizardStep runat="server" Title="Step 3">
                            Step 3</asp:WizardStep>
                        <asp:WizardStep runat="server" Title="Step 4">
                            Step 4</asp:WizardStep>
                        <asp:WizardStep runat="server" Title="Step 5">
                            Step 5</asp:WizardStep>
                    </WizardSteps>
                </asp:Wizard>
            </ContentTemplate>
        </asp:UpdatePanel>

    CS:Code

        protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
            {
                if (this.ScriptManager1.IsInAsyncPostBack &&
                    !this.ScriptManager1.IsNavigating)
                {
                    this.ScriptManager1.AddHistoryPoint(
                        "index", this.Wizard1.ActiveStepIndex.ToString(),
                        "Step " + this.Wizard1.ActiveStepIndex);
                }
            }
    
            protected void ScriptManager1_Navigate(object sender, HistoryEventArgs e)
            {
                if (String.IsNullOrEmpty(e.State["index"]))
                {
                    this.Wizard1.ActiveStepIndex = 0;
                }
                else
                {
                    this.Wizard1.ActiveStepIndex = Int32.Parse(e.State["index"]);
                }
    
            }
  • 相关阅读:
    Gym101630A Archery Tournament
    BZOJ2588 Count on a tree
    Redis主从复制
    Redis事务
    Redis持久化RDB和AOF
    设计模式之代理模式
    Spring AOP(面向切面编程)
    基于TCP和UDP的Socket通信
    Ajax无法访问回调函数seccess问题
    SpringBoot Ajax跨域问题(session共享问题)
  • 原文地址:https://www.cnblogs.com/you000/p/2831596.html
Copyright © 2011-2022 走看看