Note that there are some explanatory texts on larger screens.

plurals
  1. POdropdown list bind from xml file
    primarykey
    data
    text
    <p>I am having an issue binding a dropdown from data within an xml file. the xml file looks like so;</p> <pre><code>&lt;agricultural&gt; &lt;file&gt; &lt;text&gt;Acreage_Cotton_Planted&lt;/text&gt; &lt;value&gt;ACRECOTP Index&lt;/value&gt; &lt;/file&gt; &lt;file&gt; &lt;text&gt;Acreage_Corn_Planted&lt;/text&gt; &lt;value&gt;ACRECRNP Index&lt;/value&gt; &lt;/file&gt; &lt;file&gt; &lt;text&gt;Acreage_Soybean_Planted&lt;/text&gt; &lt;value&gt;ACRESOYP Index&lt;/value&gt; &lt;/file&gt; &lt;file&gt; &lt;text&gt;Acreage_Wheat_Planted&lt;/text&gt; &lt;value&gt;ACREWHTP Index&lt;/value&gt; &lt;/file&gt; &lt;/agricultural&gt; </code></pre> <p>I am using this code to return the list from the xml</p> <pre><code>Public Shared Function GetAgDataList(nodestring As String) As List(Of ListItem) Dim doc As New XmlDocument() 'Load XML from the file into XmlDocument object doc.Load("~\DataFiles\dataXML.xml") 'this needs to be changed to the server path Dim root As XmlNode = doc.DocumentElement 'Select all nodes with the tag paramter indicated by the nodestring variable Dim nodeList As XmlNodeList = root.SelectNodes(nodestring) Return (From node As XmlNode In nodeList Let text = node.Attributes.GetNamedItem("text").Value.ToString() Let val = node.Attributes.GetNamedItem("value").Value.ToString() Select New ListItem(text, val)).ToList() End Function </code></pre> <p>Isn't the dropdown list control only supposed to display the text? Because my dropdown is showing the text and value concatenated together. For example, Acreage_Corn_PlantedACRECRNP Index. I only want the text, Acreage_Corn_Planted, displayed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload