I have a hyperlink in my webpage and the text is set to “forgot password”.
Upon clicking the hyperlink, the password recovery control will pops up (with the implementation of AJAX ModalPopUp extender).
The pop-up of the extender works very well, it can show the password recovery control. However, after entering the username (which is in the UserNameTemplate step) and hitting the “submit” button, the control does not continue to the 2nd and 3rd steps, which should be the QuestionTemplate and success template.
I have tried putting the password recovery control onto a webpage without using the ModalPopUp extender, the recovery control works normally.
Here is my code: (words that are bold are the relevant code)
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
<asp:LoginView ID="LoginView1" runat="server" >
<AnonymousTemplate>
<asp:HyperLink ID="HyperLink2" runat="server">Forget Password</asp:HyperLink>
<asp:ModalPopupExtender ID="HyperLink2_ModalPopupExtender" runat="server" Enabled="True" TargetControlID="HyperLink2" PopupControlID="Panel1"> </asp:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" BorderColor="Black" CssClass="Panel1" > <asp:PasswordRecovery ID="PasswordRecovery1" runat="server"> </asp:PasswordRecovery>
<asp:Button ID="btnOk" runat="server" Text="Ok"/> </asp:Panel>
</AnonymousTemplate>
</form>
Why the password recovery control cannot function normally when it’s inside modalpopup extender? is there any other way to solve this??
Okay, this is because, the modal popup is set to hide by default on submit. So, as soon as you press the button, that particular form is submitted and it gets hidden.
What you can do is, on the button click event, after your necessary statements(if required), include the following line of code: