title: Getting prevalue id from umbraco dropdown list
body: <p>I'm currently trying to implement <code>AJAX</code> results filtering on a certain page.</p>
  
  <p>I created the dropdowns(on the client side), so that they have the <code>umbraco</code> prevalue id as their value.</p>
  
  <p>I will then send this id to the server, rather than the text value. Then I loop through my content to find items with this same id. </p>
  
  <p>The problem, however, is that I can't figure out <em>how to get the value id from the property</em>. Everything either returns the text value, or just a 0 value. </p>
  
  <p>This is being performed in an <code>ApiController</code>.</p>
  
  <p>These are all of the options I've tried:</p>
  
  <pre><code>IPublishedContent root = Umbraco.TypedContentAtRoot().First();
  var downloads = root.Children.Where(q =&gt; q.Name == "Downloads").SingleOrDefault();
  
  foreach (var item in downloads.Children)
  {
    var test = item.GetPropertyValue&lt;int&gt;("classification");
    var testing = item.GetProperty("classification");
    var testVal = testing.DataValue;
    var testValToo = testing.GetValue&lt;int&gt;();
    var testThree = testing.Value;
  }
  </code></pre>
  
  <p>These are the results in order:</p>
  
  <pre><code> - 0 
   - IPublishedProperty 
   - "textValue" 
   - 0 
   - "textValue"
  </code></pre>
  
  <p>Is it possible to get the selected value id from a dropdownlist property? Or is string matching my only option to compare values?</p>
  
  <p>EDIT:
  Nevermind, found the solution. Posting the answer here, in case someone else needs it. </p>
  
  <p>I was using the data type dropdownlist. I should have been using dropdownlist:publishing keys.
  dropdownlist only ever returns a value. dropdownlist:publishing keys, however, returns the prevalue id, rather than the text value. </p>
  
  <p><a href="http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors/Dropdown-Publish-Keys" rel="nofollow">Source</a></p>