c# - Password recovery not sending email. -


i have hyperlink build inside loginview , text set "forgot password".

upon clicking hyperlink, password recovery control pops (with implementation of ajax modalpopup extender).the modalpopup work well. problem is, after entering username , in step2 after user had answered his/her security answer , when on hit on "submit" button, not proceed step 3 , no email send.

however, password changed in database (i tried log in username , old password , did not work).

here code @ passwordrecover.aspx :

<asp:hyperlink id="hyperlink2" runat="server" style="margin-top:15px; text-align: right;">forget password</asp:hyperlink> <asp:modalpopupextender id="hyperlink2_modalpopupextender" runat="server" backgroundcssclass="modalbackground" dynamicservicepath="" enabled="true" popupcontrolid="panel1" targetcontrolid="hyperlink2" > </asp:modalpopupextender> <asp:panel id="panel1" runat="server" backcolor="white" bordercolor="black" borderstyle="solid" borderwidth="2px" height="200px" width="360px"> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:passwordrecovery id="passwordrecovery1" runat="server" onsendingmail="passwordrecovery1_sendingmail"> <maildefinition bodyfilename="~/emailtemplates/resetpassword.htm" from="bedofrosesptltd@gmail.com" isbodyhtml="true" priority="high" subject="request on password reset bedofroses's account."> </maildefinition> </asp:passwordrecovery> </contenttemplate> </asp:updatepanel> <asp:button id="btnclose" runat="server" text="close" /> </asp:panel> 

here code behind:

 protected void passwordrecovery1_sendingmail(object sender, mailmessageeventargs e) { system.web.ui.webcontrols.passwordrecovery passwordrecovery1 = (system.web.ui.webcontrols.passwordrecovery)loginview1.findcontrol("passwordrecovery1"); membershipuser pwrecover = membership.getuser(passwordrecovery1.username); guid userinfoid2 = (guid)pwrecover.provideruserkey; //create url link userprofile.aspx , //accept query string user's id //setup base of url string domainname = request.url.getleftpart(uripartial.authority) + request.applicationpath; //setup second half of url string confirmationpage = "/members/userprofile.aspx?id=" + userinfoid2.tostring(); //combine make final url string url = domainname + confirmationpage; // replace <%verifyurl%> placeholder url value e.message.body = e.message.body.replace("<%resetpassword%>", url); } 
  • if remove password recovery control modalpopup, whole control work perfectly. when build inside modalpopup, not proceed last step , no email send. yet user not logged in when his/her username , old password.

the probable reason when form opened in model popup, form (i.e password recovery form) no more remains inside form tag. need similar

jquery(function() { var dlg = jquery("#dialog").dialog({ draggable: true, resizable: true, show: 'transfer', hide: 'transfer', width: 320, autoopen: false, minheight: 10, minwidth: 10 }); dlg.parent().appendto(jquery("form:first")); }); 

it moving popup inside form dom. , when form not inside form dom it's data won't posted server.

ref: jquery ui dialog asp.net button postback


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -