DNN Default "Retrieve Password" Link Redirection

Mar 5, 2013 at 6:09 PM
Hi,
I tried to use this module by creating a new page (e.g. Forgotten Password Page - ForgottenPassword.aspx) and dropped the module in. Now, I'm trying to figure out how can I redirect the default DNN Login Control "RETRIEVE PASSWORD" button/link to go the newly created page.
Are there other settings I need to adjust to use the module?
Thanks, olan
Coordinator
Mar 5, 2013 at 6:45 PM
You have to modify the core of DNN to change this link as there is no configuration process for this at the point in time.

You can e-mail me directly for help if you would like. msellers@iowacomputergurus.com
Apr 23, 2013 at 7:29 PM
Thanks Mitchel for the offline guide and help.
I finally got it working after reading some UpdatePanels behavior ( http://msdn.microsoft.com/en-us/library/bb383810(v=vs.100).aspx ). Whether this workaround is best practice or not - I wouldn't know. Right now, I'll take this...
The good thing about the workaround is one does not have to touch the core.
I implemented it this way.
  1. Create a new page (e.g. ForgottenCredentials.aspx).
  2. Drop the Secure PWD module.
  3. In the built-in Account Login module (under Module Settings > Advanced Settings > Footer), I inserted the following lines of code:
<script type="text/javascript">
    (function($) {
        var retURL = $('a[id$=Login_Login_DNN_passwordLink]').attr('href');
        retURL = retURL.substring(retURL.indexOf('returnurl'));
        retURL = retURL.replace('%2f','/');
        $('a[id$=Login_Login_DNN_passwordLink]').attr('href', 'http://yourdomain.com/ForgottenCredentials.aspx?' + retURL);
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_endRequest(function() {
            var retURL = $('a[id$=Login_Login_DNN_passwordLink]').attr('href');
            retURL = retURL.substring(retURL.indexOf('returnurl'));
            retURL = retURL.replace('%2f','/');
            $('a[id$=Login_Login_DNN_passwordLink]').attr('href', 'http://yourdomain.com/ForgottenCredentials.aspx?' + retURL);
        });
    })(jQuery);
</script>
Coordinator
Apr 23, 2013 at 8:07 PM
Thanks for this! It is a nice solution for an extension point that is missing!
Oct 2, 2013 at 6:10 PM
Edited Oct 2, 2013 at 7:41 PM
Do you know if this still works with DNN 7? It's not redirecting for me.
Mar 25, 2014 at 5:14 PM
Edited Mar 25, 2014 at 5:15 PM
This javascript didn't work for me as the Id's of the elements had random numbers.

I decided the easiest solution was to hide the retreive password link. On the login page, underneath the login module can then be a seperate html module with the link which is nice as it can then be easily managed.

Here is my alternative javascript to hide the retrieve password link:-
<script type="text/javascript">
    (function($) {
      $( ".ModAuthenticationC .dnnSecondaryAction")[1].style.display='none'
    })(jQuery);
</script>
Sep 12, 2014 at 9:23 AM
Dumb question I guess, but how do you get to the built-in Account Login module?
Coordinator
Sep 12, 2014 at 12:48 PM

​Which version of DNN are you on?


Mitchel Sellers
Microsoft C# MVP, DNN MVP
CEO/Director of Development
IowaComputerGurus, Inc.

Office: (515) 270-7063
Cell: (515) 707-3629
Fax: (866) 591-3679

Sep 12, 2014 at 2:39 PM
I figured it out. Thanks. The problem was fixed when I to deleted this file from the App_GlobalResouces folder:
GlobalResources.Host.resx