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"?>

and here is my aspx.cs file

using System;
using System.Xml;

	XmlDocument lblDocument = new XmlDocument();
            SaveBtn.Text = lblDocument.GetElementsByTagName("btn");

Thanks guys

- joel

Recommended Answers

All 2 Replies

Method GetElementsByTagName return an object of NodeList.

XmlNodeList nodelist= lblDocument.GetElementsByTagName("btn");
 if (nodelist.Count != 0)
    SaveBtn.Text = nodelist.Item(0).InnerText;

Super Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.