2010-06-04 86 views

回答

0

我最近這個問題發現,你需要你的控件ID

檢查之前添加StepNavigationTemplateContainerID $這項blog

Button finishButton = Wizard1.FindControl("StepNavigationTemplateContainerID$FinishButton") as Button; 
1

使alejandrobog的工作中,u必須轉換爲StepNavigation模板

<StepNavigationTemplate> 
    <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious">Previous</asp:Button> 
    <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext">Next</asp:Button> 
</StepNavigationTemplate> 

隨後的FindControl工作

Button btnPre = (Button)Wizard1.FindControl("StepNavigationTemplateContainerID$StepPreviousButton"); 
btnPre.Visible = false; 
Button btnNext = (Button)Wizard1.FindControl("StepNavigationTemplateContainerID$StepNextButton"); 
btnNext.Visible = false; 
0
((Button)Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("btnBack")).Visible = false; 

FinishNavigationTemplateContainerID也可以StepNavigationTemplateContainerID - 那是一個固定的名字,使用你給<asp:WizardStep ID="Step2"

Wizard1 ID是你的ASP的ID:WIZZARD

btnBack是您的asp:Button的ID,如 <FinishNavigationTemplate> <asp:Button ID="btnBack"