ASP.NET PasswordRecovery Control with localized content

I am working on a simple portal application using ASP.NET controls and inputs. I would like to use the PasswordRecovery control to send emails containing forgotten passwords, however, my portal requires localization. I have an existing content management system from which I take out localized strings, and I would like to associate the PasswordRecovery control with this system.

But it looks like the PasswordRecovery control will ONLY accept the .txt file for the email body ... PasswordRecovery1.MailDefinition.BodyFileName property

I do not want to use the file on disk, I would like to use localized content in my CMS.

Is there any way to do this? It occurred to me that I could use the SendingMail event to send my OWN email through the regular System.Net namespace, but this seems inconvenient ...

Any thoughts?

Thanks Max

+3
source share
2 answers

Try handling the SendingMail event of the PasswordRecovery control. In this case, set the e.Message.Body and e.Message.Subject properties for your localized text.

+4
source

This was discovered by googling "LocalFileName localization":

http://forums.asp.net/t/1118242.aspx :

localresource . - , app_localresources . "tools β†’ " .

/ -

: myBodyFileName

: myDefaultBodyFile.txt

BodyFileName -

' >

/ .

, , , automatticaly. "MyChangePasswordControlResource1.BodyFileName" - .

,

0

Source: https://habr.com/ru/post/1698527/


All Articles