title: set asp.net dropdown selected value with jquery
body: <p>I have a code which should work just fine for setting up a selected value on asp.net dropdownlist but for some reason it doesn't want to work in my case although it works normally in other projects I've been working on.
  So this is the dropdown:</p>
  
  <pre><code>  &lt;asp:DropDownList ID="ddlPerc" runat="server"&gt;
                               &lt;asp:ListItem Value=""&gt;Select Percentage&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.01"&gt;0.01&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.05"&gt;0.05&lt;/asp:ListItem&gt;        
                   &lt;asp:ListItem Value="0.1"&gt;0.1&lt;/asp:ListItem&gt;  
                               &lt;asp:ListItem Value="0.15"&gt;0.15&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.2"&gt;0.2&lt;/asp:ListItem&gt;    
                               &lt;asp:ListItem Value="0.25"&gt;0.25&lt;/asp:ListItem&gt;  
                               &lt;asp:ListItem Value="0.3"&gt;0.3&lt;/asp:ListItem&gt;   
                               &lt;asp:ListItem Value="0.4"&gt;0.4&lt;/asp:ListItem&gt;                                                                
                               &lt;asp:ListItem Value="0.48"&gt;0.48&lt;/asp:ListItem&gt;                                                                  
                               &lt;asp:ListItem Value="0.5"&gt;0.5&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.52"&gt;0.52&lt;/asp:ListItem&gt;      
                               &lt;asp:ListItem Value="0.6"&gt;0.6&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.7"&gt;0.7&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.75"&gt;0.75&lt;/asp:ListItem&gt;                                                                  
                               &lt;asp:ListItem Value="0.8"&gt;0.8&lt;/asp:ListItem&gt;                                 
                               &lt;asp:ListItem Value="0.85"&gt;0.85&lt;/asp:ListItem&gt;    
                               &lt;asp:ListItem Value="0.9"&gt;0.9&lt;/asp:ListItem&gt;                                 
                               &lt;asp:ListItem Value="0.95"&gt;0.95&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="0.99"&gt;0.99&lt;/asp:ListItem&gt;
                               &lt;asp:ListItem Value="1"&gt;1&lt;/asp:ListItem&gt;
                               &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>And the jquery code which should work is this:</p>
  
  <pre><code>  $(document).on("click", ".open-AddBookDialog", function () {                                       
                var sign = "1";
           $('dropdownAgentPerc option')
          .filter(function () { return $.trim($(this).val()) == sign; })
           .attr('selected', true);
                $('#addBookDialog').modal('show');
  </code></pre>
  
  <p>When i am checking the source of the page I can see that the value has the tag Selected to true but in the modal popup that value is still not selected.
  Any idea what can be the reason?
  Thanks in advance, Laziale</p>