Last post Jun 08, 2007 04:34 PM by Pluginbaby
Jun 04, 2007 09:28 PM|Pluginbaby|LINK
I'm using Login controls to authenticate users.
On one page (already localized), I use ChangePassword control to send emails to users to notify them with MailDefinition.BodyFileName property.
But how can I localize text using BodyFileName attribute?
Jun 04, 2007 11:24 PM|ProdyK|LINK
Just bind the property to a key in your page's localresource file. The page's local resource file is the file located in a subdirectory called app_localresources in your page's directory. Just use visual studio's "tools -> create local resource" option
in design view for it be created for you.
In that file, create a string key/value pair with something like
Then bind this to the BodyFileName property of the login control with something like
<asp:ChangePassword id="myControl" BodyFileName='<%# (String)GetLocalResourceObject("MyBodyFileName") %>'>
Then just create the sattelite local resource files for other cultures and map that key/value pair in those resources to other body text files.
Jun 04, 2007 11:33 PM|ProdyK|LINK
By the way, if you used visual studio to create the resource file for you, then the binding may have been done for you automatticaly. Just search for a "MyChangePasswordControlResource1.BodyFileName" key in the resource file or something similar.
Jun 07, 2007 02:47 AM|Pluginbaby|LINK
Thanks for the answer.
Unfortunatly no, it did not create an entry for BodyFileName in the generated resource file.
Jun 08, 2007 04:34 PM|Pluginbaby|LINK
It is ok to enter manually the key CreateUserWizard1Resource1.MailDefinition.BodyFileName in the resource file.
So problem is solved, thanks.