I
Islam Elkhayat
In my web application i use satalite assembly to localize my web form..
Instead of set the each control text to the resourcemanager getstring()
method i try to use foreach loop
private string rmg(string key)
{
return resource.GetString("key");
}
private Literal ctrl_txt()
{
foreach (Literal lit_xyz in this.Controls)
{
string str= lit_xyz.ID;
string key= str.Substring(3);
lit_xyz.Text= rmg(key);
return lit_xyz;
}
return null;
}
this foreach genrate InvalidCastException... How can i fix this??
Instead of set the each control text to the resourcemanager getstring()
method i try to use foreach loop
private string rmg(string key)
{
return resource.GetString("key");
}
private Literal ctrl_txt()
{
foreach (Literal lit_xyz in this.Controls)
{
string str= lit_xyz.ID;
string key= str.Substring(3);
lit_xyz.Text= rmg(key);
return lit_xyz;
}
return null;
}
this foreach genrate InvalidCastException... How can i fix this??