zoukankan      html  css  js  c++  java
  • Wizard里的button事件

     1    
     2    protected void Page_Load(object sender, EventArgs e)
     3    {
     4        //向导控件
     5        //动态添加事件
     6        
     7        Wizard.NextButtonClick += new WizardNavigationEventHandler(Wizard_NextButtonClick);//下一步
     8        Wizard.PreviousButtonClick += new WizardNavigationEventHandler(Wizard_PreviousButtonClick);//上一步
     9        Wizard.ActiveStepChanged += new EventHandler(Wizard_ActiveStepChanged);//改变步骤时一事件
    10        Wizard.FinishButtonClick +=new WizardNavigationEventHandler(Wizard_FinishButtonClick);//完成
    11        if (!IsPostBack)
    12        {
    13            BindData();  
    14        }
     
    15           
    16    }

    17
    18
    19    void Wizard_NextButtonClick(object sender, WizardNavigationEventArgs e)
    20    {
    21        e.Cancel = true;
    22        try
    23        {
    24            switch (e.CurrentStepIndex)
    25            {
    26                case 0:
    27                    if(ChkInstall())
    28                        e.Cancel = false;
    29                    break;
    30                case 1:
    31                    if (UpdateConfig())
    32                        e.Cancel = false;
    33                    break;
    34               
    35                case 2:
    36                    if (DatabaseConfig())
    37                        e.Cancel = false;
    38                    break;
    39                case 3:
    40                    if (UpgradeDatabase())
    41                        e.Cancel = false;
    42                  
    43                    Wizard.StepPreviousButtonStyle.CssClass = "hide" ;
    44                    break;
    45                case 4:
    46                    if (SetAdmin())
    47                        e.Cancel = false;
    48                    break;
    49            }

    50        }

    51        catch (Exception x)
    52        {
    53             //throw x;
    54            e.Cancel = true;
    55            AddLoadMessage(x.Message);
    56        }

    57       
    58    }

    59
    60
    61    void Wizard_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
    62    {
    63        BindData();   //上一步时绑定数据
    64    }

    65
    66    void Wizard_ActiveStepChanged(object sender, EventArgs e)
    67    {
    68       // Wizard.ActiveStepIndex++;
    69    }

    70
    71    protected void Wizard_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    72    {
    73        Response.Redirect("~/");
    74    }
  • 相关阅读:
    tornado-cookies+pycket 验证
    解决form表单通过ajax时,required失效问题
    如何判断一个文件是否存在
    django中@property装饰器的运用
    RestFul API接口设计风格介绍和核心功能(概念)
    python中各个response使用
    Python的命名规则
    break和continue的区别
    LOCK接口
    API
  • 原文地址:https://www.cnblogs.com/htht66/p/1105434.html
Copyright © 2011-2022 走看看