Localize MailDefinition BodyFileName text file

ManicCW

Well-known member
Joined
Jul 21, 2005
Messages
428
Location
Mostar
Programming Experience
Beginner
Hi,

I'm using Login controls to authenticate users.
My pages are fully localized.
When I use ChangePassword control I send mail to users to notify them.
How can I send localized text using BodyFileName attribute? :confused:
 
I have found temporary solution, but I don't like it.
Here it is:

VB.NET:
    Protected Sub logChangePass_ChangingPassword(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles logChangePass.ChangingPassword

        Dim ci As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture
        Dim filePath As String = Me.logChangePass.MailDefinition.BodyFileName.Replace(".txt", "." & ci.TwoLetterISOLanguageName & ".txt")
        If IO.File.Exists(Server.MapPath(filePath)) Then
            Me.logChangePass.MailDefinition.BodyFileName = filePath
        End If

    End Sub

There must be a better solution. :confused:
 
Back
Top