我有一个这样的向导设置:
<asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="false" onnextbuttonclick="OnNextButtonClick">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
<div class="content">
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
<div class="content">
<asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
</div>
</asp:WizardStep> ...more
然后在该页面的预渲染中添加控件,如下所示:
protected void Wizard1_PreRender(object sender, EventArgs e)
{
PlaceHolder1.Controls.Add(LoadControl("Control1.ascx"));
PlaceHolder2.Controls.Add(LoadControl("Control2.ascx"));
PlaceHolder3.Controls.Add(LoadControl("Control3.ascx"));
...more controls added
}
在 .ascx 控件上,我有一个 ajaxToolkit:TabContainer 我想像这样访问它:
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<ajaxToolkit:TabPanel ID="TabPanel1" HeaderText="PRV 1" runat="server">
所以我想要做的是阻止向导进入下一步并将 ajaxtoolkit:Tabcontainer 移动到下一个选项卡。我正在像这样访问下一个按钮:
protected void OnNextButtonClick(object sender, WizardNavigationEventArgs e)
{
if(Wizard1.ActiveStepIndex == 2)
{
e.Cancel = true;
//get ajaxToolKit:tabcontrol here
}
}
关于如何在 OnNextButtonClick 函数中访问 TabControl 的任何想法?这是一个 asp.net 网络应用程序。