在向导中找不到“下一步”按钮控件
我正在尝试使用 FindControls 方法在向导中查找“下一步”按钮,以便将其设置为默认按钮,但我似乎找不到它。
这是在 IE 中查看源代码的控件名称:
ctl00_MainContentPlaceHolder_ApplicationWizard_StartNavigationTemplateContainerID_StartNextButton
这是我用来设置默认按钮的代码块:
Page.Form.DefaultButton = ApplicationWizard.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton").UniqueID;
但是,它找不到 StartNavigationTemplateContainerID 控件。 我在这里做错了什么?
I am trying to use the FindControls method to find the Next Button in my Wizard so I can set it as the default button, but I can't seem to find it.
Here is the control name from View Source in IE:
ctl00_MainContentPlaceHolder_ApplicationWizard_StartNavigationTemplateContainerID_StartNextButton
This is the code block I'm using to set the default button:
Page.Form.DefaultButton = ApplicationWizard.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton").UniqueID;
However, it can't find the StartNavigationTemplateContainerID control. What am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在向导中找不到下一个按钮,但我是这样找到的:
Button btnNext = (Button)MyWizard.FindControl("StartNavigationTemplateContainerID$StartNextButton");
我发现此博客很有帮助。
I was having trouble finding the next button on my wizard, but I found it this way:
Button btnNext = (Button)MyWizard.FindControl("StartNavigationTemplateContainerID$StartNextButton");
I found this blog helpful.