Hello this is my XML File :
<?xml version="1.0" encoding="utf-8" ?>
<Countries>
<Country id="0"> <!-- AUSTRALIA -->
<Label1>ABN</Label1>
<TextBoxLimit1>14</TextBoxLimit1>
<Label2>ACN</Label2>
<TextBoxLimit2>14</TextBoxLimit2>
</Country>
<Country id="1"> <!-- PAKISTAN -->
<Label1>NTN</Label1>
<TextBoxLimit1>20</TextBoxLimit1>
<Label2>BNN</Label2>
<TextBoxLimit2>22</TextBoxLimit2>
</Country>
<Country id="2"> <!-- SAUDIA ARABIA -->
<Label1>STT</Label1>
<TextBoxLimit1>18</TextBoxLimit1>
<Label2>SDP</Label2>
<TextBoxLimit2>24</TextBoxLimit2>
</Country>
<Country id="3"> <!-- INDIA -->
<Label1>ITT</Label1>
<TextBoxLimit1>28</TextBoxLimit1>
<Label2>IDP</Label2>
<TextBoxLimit2>20</TextBoxLimit2>
</Country>
</Countries>
Now i want to get the country id by searching for example :
ITT in Label1 and IDP in Label 2
how to achieve this task ?
Note : Below is the method from where i am fetching the country id on page_load event in XML File :
public void bindXML(string nodeID)
{
var xml = new XmlDocument();
xml.Load(Server.MapPath("FormsConfig.xml"));
XmlNodeList xnList = xml.SelectNodes("/Countries/Country[@id='" + nodeID + "']");
foreach (XmlNode xn in xnList)
{
string a = xn["Label1"].InnerText;
string b = xn["TextBoxLimit1"].InnerText;
string c = xn["Label2"].InnerText;
string d = xn["TextBoxLimit2"].InnerText;
smallWarning.Text = "(max " + b + " digits)";
smallWarning2.Text = "(max " + d + " digits)";
ABNLabel.Text = a + " Number";
ACNLabel.Text = c + " Number";
ABN_Number.MaxLength = Convert.ToInt32(b);
ACN_Number.MaxLength = Convert.ToInt32(d);
}
}