FindControl 不适用于我的 ChangePassword 控件
如何访问 CancelPushButton
?
这不行!它总是返回null
!
var cancelButton = ChangeUserPassword.FindControl("CancelPushButton");
ASP.Net 代码:
<ChangePasswordTemplate>
<span class="failureNotification">
<asp:Literal ID="FailureText" runat="server"></asp:Literal>
</span>
<asp:ValidationSummary ID="ChangeUserPasswordValidationSummary" runat="server" CssClass="failureNotification"
ValidationGroup="ChangeUserPasswordValidationGroup"/>
<div class="accountInfo">
<p class="submitButton">
<asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
<asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword" Text="Change Password"
ValidationGroup="ChangeUserPasswordValidationGroup"/>
</p>
</div>
</ChangePasswordTemplate>
任何帮助!
How can I access to the CancelPushButton
?
This doesn't work ! it returns always null
!!
var cancelButton = ChangeUserPassword.FindControl("CancelPushButton");
ASP.Net code:
<ChangePasswordTemplate>
<span class="failureNotification">
<asp:Literal ID="FailureText" runat="server"></asp:Literal>
</span>
<asp:ValidationSummary ID="ChangeUserPasswordValidationSummary" runat="server" CssClass="failureNotification"
ValidationGroup="ChangeUserPasswordValidationGroup"/>
<div class="accountInfo">
<p class="submitButton">
<asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
<asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword" Text="Change Password"
ValidationGroup="ChangeUserPasswordValidationGroup"/>
</p>
</div>
</ChangePasswordTemplate>
Any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看这个: http://weblogs.asp.net/sukumarraju/archive/2011/02/13/access-controls-with-in-change-password-control.aspx
它有这个例子:
HTH。
Check this out: http://weblogs.asp.net/sukumarraju/archive/2011/02/13/access-controls-with-in-change-password-control.aspx
It has this example:
HTH.
从这篇文章中,这个方法会找到需要的控件。
From this article, this method will find the required control.