I have a function to fill in a user's first name, last name and email address when they are logged into our web site. But, now that we have translated our pages into dozens of languages, a bug has come up. When the field name is translated from English, it is not found and the field is not populated. Other than adding each of the foreign languages to the conditional statement, is there a way to fix this bug by using the item name instead of the title?
private void FillInUserData(Control control)
{
foreach (Control child in control.Controls)
{
if (child is BaseControl)
{
if (child is InputControl)
{
InputControl field = (InputControl)child;
if (field.Title.Equals("Email Address"))
{
field.Text = UserSession.EmailAddress;
}
}
}
}
}