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"]);
                }
    
            }
  • 相关阅读:
    python学习随笔--string[:]
    年少时读不懂 天龙八部,如今读懂已过少年
    web安全测试随笔
    纪录jmeter loop controller 使用中的一个坑
    移动设备覆盖统计数据源
    jmeter and postman
    web测试----http状态码
    转自莫某的java学习计划
    jquery实现页面加载时删除特定class 的div内前三个字符
    js学习
  • 原文地址:https://www.cnblogs.com/you000/p/2831596.html
Copyright © 2011-2022 走看看