title: C# : Populating form fields based on user selection using an XML file
body: <p>On my form, I have 2 fields set up. Location of item, and sub-area. I am trying to populate the sub-area field based on what location the user chooses. For instance, they choose "Location 4". The only 3 sub-areas for that location are, lets say, A, B, and C. Upon selection in the location box, the sub-area box will only display A, B, and C. I have all the locations and allowed sub areas in an xml file called appsettings.xml. How do I get the program to read in the xml file and allow the sub area field to only be populated with valid data? Below is an example of how I have my xml file set up.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
   &lt;MerchandiseTrack&gt;
  
     &lt;Merchandise_Zones Application_Data="Test-Run"&gt;
  
        &lt;KeyBoard_App&gt;
          &lt;AppString&gt;c windows osk.exe&lt;/AppString&gt; 
        &lt;/KeyBoard_App&gt;
  
   &lt;Storage_Location&gt;
  
       &lt;head id="Location"&gt;                // Name of box on app
         &lt;body id="04"&gt;                    // Name of Location within the box
           &lt;Sub-Area&gt;A, B, C,&lt;/Sub-Area&gt;   // Allowed sub-areas
         &lt;/body&gt;
       &lt;/head&gt;
  
       &lt;head id="Location"&gt;                // Name of box on app  
        &lt;body id="05"&gt;                     //Name of Location within the box
           &lt;Sub-Area&gt;P, L, R, B&lt;/Sub-Area&gt; // Allowed sub-areas 
        &lt;/body&gt;
       &lt;/head&gt;
  
       &lt;head id="Location"&gt;                // Name of box on app
        &lt;body id="14"&gt;                     //Name of Location within the box
         &lt;Sub-Area&gt;A, X, C &lt;/Sub-Area&gt;     //Name of Location within the box
        &lt;/body&gt;
      &lt;/head&gt;
  
    &lt;/Storage_Location&gt;
   &lt;/Merchandise_Zones&gt;
  &lt;/MerchandiseTrack&gt;
  </code></pre>