Need help guys.. I need to separate all labels from aspx & aspx.cs file to XML file but I getting this error
Compiler Error Message: CS0029: Cannot implicitly convert type 'System.Xml.XmlNodeList' to 'string'
here is my xml file
<?xml version="1.0" encoding="iso-8859-1"?> <labels> <btn>Update</btn> </labels>
and here is my aspx.cs file
using System; using System.Xml; XmlDocument lblDocument = new XmlDocument(); lblDocument.Load(Server.MapPath("label.xml")); SaveBtn.Text = lblDocument.GetElementsByTagName("btn");
Thanks guys
- joel
Method GetElementsByTagName return an object of NodeList.
XmlNodeList nodelist= lblDocument.GetElementsByTagName("btn"); if (nodelist.Count != 0) SaveBtn.Text = nodelist.Item(0).InnerText;
Super Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!