Click here to Skip to main content
15,909,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Want to change the Text of label of resource file Dynamically
Using below code....
m changing the value through item index but it does not changing the correct index...
Please Help me...
Give me solution..

public string filename;

filename = "ProductCollection.aspx.resx";
filename = Request.PhysicalApplicationPath + "App_LocalResources\\" + filename;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(filename);
XmlNodeList nlist = xmlDoc.GetElementsByTagName("data");
XmlNode childnode = nlist.Item(33);
childnode.Attributes["xml:space"].Value = "default";
xmlDoc.Save(filename);
XmlNode lastnode = childnode.SelectSingleNode("value");
lastnode.InnerText = "COLLECTIONS";
xmlDoc.Save(filename);

filename = "ProductCollection.aspx.it.resx";
filename = Request.PhysicalApplicationPath + "App_LocalResources\\" + filename;
XmlDocument xmlDoc1 = new XmlDocument();
xmlDoc1.Load(filename);
XmlNodeList nlist1 = xmlDoc1.GetElementsByTagName("data");
XmlNode childnode1 = nlist1.Item(33);
childnode1.Attributes["xml:space"].Value = "default";
xmlDoc1.Save(filename);
XmlNode lastnode1 = childnode1.SelectSingleNode("value");
lastnode1.InnerText = "COLLEZIONI";
xmlDoc1.Save(filename);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900