如何访问Wizard控件里的按钮
生活随笔
收集整理的這篇文章主要介紹了
如何访问Wizard控件里的按钮
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一個(gè)簡(jiǎn)單的例子。
aspx:
<asp:wizard?id="Wizard1"?runat="server">
????<wizardsteps>
????????<asp:wizardstep?id="step1"?runat="server"?onactivate="step1_Activate"?title="Step?1">
????????????Step?1
????????</asp:wizardstep>
????????<asp:wizardstep?id="step2"?runat="server"?onactivate="step2_Activate"?title="Step?2">
????????????Step?2
????????</asp:wizardstep>
????????<asp:wizardstep?id="step3"?runat="server"?onactivate="step3_Activate"?title="Step3">
????????????Step?3
????????</asp:wizardstep>
????</wizardsteps>
</asp:wizard>
CODE-BEHIND:
protected?void?Page_Load(object?sender,?EventArgs?e)
{
????if?(!this.IsPostBack)
????{
????????this.step1_Activate(step1,?EventArgs.Empty);
????}
}
protected?void?step1_Activate(object?sender,?EventArgs?e)
{
????Button?next?=?Wizard1.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton")?as?Button;
}
protected?void?step2_Activate(object?sender,?EventArgs?e)
{
????Button?previous?=?Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepPreviousButton")?as?Button;
????Button?next?=?Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton")?as?Button;
}
protected?void?step3_Activate(object?sender,?EventArgs?e)
{
????Button?previous?=?Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishPreviousButton")?as?Button;
????Button?finish?=?Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton")?as?Button;
}
aspx:
<asp:wizard?id="Wizard1"?runat="server">
????<wizardsteps>
????????<asp:wizardstep?id="step1"?runat="server"?onactivate="step1_Activate"?title="Step?1">
????????????Step?1
????????</asp:wizardstep>
????????<asp:wizardstep?id="step2"?runat="server"?onactivate="step2_Activate"?title="Step?2">
????????????Step?2
????????</asp:wizardstep>
????????<asp:wizardstep?id="step3"?runat="server"?onactivate="step3_Activate"?title="Step3">
????????????Step?3
????????</asp:wizardstep>
????</wizardsteps>
</asp:wizard>
CODE-BEHIND:
protected?void?Page_Load(object?sender,?EventArgs?e)
{
????if?(!this.IsPostBack)
????{
????????this.step1_Activate(step1,?EventArgs.Empty);
????}
}
protected?void?step1_Activate(object?sender,?EventArgs?e)
{
????Button?next?=?Wizard1.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton")?as?Button;
}
protected?void?step2_Activate(object?sender,?EventArgs?e)
{
????Button?previous?=?Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepPreviousButton")?as?Button;
????Button?next?=?Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton")?as?Button;
}
protected?void?step3_Activate(object?sender,?EventArgs?e)
{
????Button?previous?=?Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishPreviousButton")?as?Button;
????Button?finish?=?Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton")?as?Button;
}
轉(zhuǎn)載于:https://www.cnblogs.com/straw808/archive/2007/10/10/919831.html
總結(jié)
以上是生活随笔為你收集整理的如何访问Wizard控件里的按钮的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 宾浪超.何飞玲.相爱(帮别人名字隔字作诗
- 下一篇: phpMyAdmin下载、安装和使用入门