简体   繁体   English

如何在代码中访问ASP.Net向导完成按钮?

[英]How can I Access ASP.Net Wizard Finish Button in Code?

I have an asp.net wizard control with the "finish" button defined in the FinishNavigationTemplate . 我有一个asp.net向导控件,其中FinishNavigationTemplate定义了“finish”按钮。 I would like to access that button in code to give it focus if finishing the wizard does not complete. 如果完成向导没有完成,我想在代码中访问该按钮以使其成为焦点。

I've tried doing a FindControl on the WizardStep like so: 我试过在WizardStep上做一个FindControl,如下所示:

Button b = (Button) wsReviewOrder.FindControl("FinishButton");

I've tried doing a FindControl on the entire Wizard control like so: 我试过在整个Wizard控件上做一个FindControl,如下所示:

Button b = (Button) wCheckout.FindControl("FinishButton");

Neither of these worked for me. 这些都不适合我。

I ran across this post which helped me get the answer: 我跑过这篇文章,帮助我得到了答案:

http://forums.asp.net/t/903710.aspx http://forums.asp.net/t/903710.aspx

This is what worked for me: 这对我有用:

Button b = (Button)wCheckout.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM