更新面板中的验证摘要问题 [英] problem with validation summary in update panel

查看:80
本文介绍了更新面板中的验证摘要问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

i在更新面板中使用asp.net会员更改密码,

当我填写文本框并单击提交按钮时,我的texbox被重置并清空并显示RequiredFieldValidator错误,



请输入密码

请输入新密码

请输入确认新密码



并且不显示密码更改成功的任何消息,

i当我点击按钮updProgress显示时,并显示正确的错误



我的代码是:

hello,
i use asp.net membership change password in update panel,
when i fill textbox and click in submit button my texbox was reset and empty and show RequiredFieldValidator error,

please enter password
please enter new password
please enter confirm new password

and don't show any message for password change success,
i want when i click the button updProgress is show, and show correct error

my code is :

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
   <asp:UpdateProgress ID="updProgress" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
       <ProgressTemplate>
           <img src="../Static/Css/Images/loading.gif" />
           now connecting to the server ...
       </ProgressTemplate>
   </asp:UpdateProgress>
   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <Triggers>
           <asp:AsyncPostBackTrigger runat="server" ControlID="ChangePasswordPushButton" />
       </Triggers>
       <ContentTemplate>
           <asp:ChangePassword ID="ChangePassword1" runat="server" ChangePasswordButtonText="change your password" CancelButtonText="cancel" ChangePasswordTitleText="change your password" ConfirmNewPasswordLabelText="conferm your password" ConfirmPasswordCompareErrorMessage="the new password same must be the conferm password." ConfirmPasswordRequiredErrorMessage="please enter your conferm password." NewPasswordLabelText="new password:" NewPasswordRegularExpressionErrorMessage="the new password in not accept.please change your password" NewPasswordRequiredErrorMessage="type the new password." PasswordLabelText="last password:" PasswordRequiredErrorMessage="type new password." SuccessText="your password changed successfuly." UserNameLabelText="user name:" UserNameRequiredErrorMessage="please type your user name." ChangePasswordFailureText="the last password or the new passwor is not corrent.password must be {0} character and {1}. ">
               <ChangePasswordTemplate>
                   <table cellpadding="1" cellspacing="0" style="border-collapse: collapse;">
                       <tr>
                           <td>
                               <table cellpadding="0">
                                   <tr>
                                       <td align="center" colspan="2">change your password</td>
                                   </tr>

                                   <tr>
                                       <td align="right">
                                           <asp:Label ID="CurrentPasswordLabel" runat="server" AssociatedControlID="CurrentPassword">last password:</asp:Label>
                                       </td>
                                       <td>
                                           <asp:TextBox ID="CurrentPassword" runat="server" TextMode="Password"></asp:TextBox>
                                           <asp:RequiredFieldValidator ID="CurrentPasswordRequired" runat="server" ControlToValidate="CurrentPassword" ErrorMessage="please enter password." ToolTip="please enter password." ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td align="right">
                                           <asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">new password:</asp:Label>
                                       </td>
                                       <td>
                                           <asp:TextBox ID="NewPassword" runat="server" TextMode="Password"></asp:TextBox>
                                           <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" ControlToValidate="NewPassword" ErrorMessage="please enter new password" ToolTip="please enter new password" ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td align="right">
                                           <asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">conferm the passwordد:</asp:Label>
                                       </td>
                                       <td>
                                           <asp:TextBox ID="ConfirmNewPassword" runat="server" TextMode="Password"></asp:TextBox>
                                           <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" ControlToValidate="ConfirmNewPassword" ErrorMessage="please enter confirm new password" ToolTip="please enter confirm new password." ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td align="center" colspan="2" style="color: Red;">
                                           <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td align="center" colspan="2">
                                           <asp:CompareValidator ID="NewPasswordCompare" runat="server" ControlToCompare="NewPassword" ControlToValidate="ConfirmNewPassword" Display="Dynamic" ErrorMessage="t" ValidationGroup="ChangePassword1"></asp:CompareValidator>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td align="right">
                                           <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="ChangePassword1" DisplayMode="List" />
                                       </td>
                           </td>
                           <td>
                               <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="cancle" UseSubmitBehavior="False" ValidationGroup="ChangePassword1" />
                           </td>
                       </tr>
                       <td>
                       </tr>
                   </table>
                   </td>
                                                   </tr>
                                               </table>
               </ChangePasswordTemplate>
               <SuccessTextStyle ForeColor="#66FF33" />
           </asp:ChangePassword>
       </ContentTemplate>
   </asp:UpdatePanel>
   <asp:UpdatePanel ID="UpdatePanel2" runat="server">
       <ContentTemplate>
           <asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword" Text="change your password" UseSubmitBehavior="False" ValidationGroup="ChangePassword1" />
       </ContentTemplate>
   </asp:UpdatePanel>

推荐答案

try by removing update panel from code
try by removing update panel from code


这篇关于更新面板中的验证摘要问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆