title: How to preserve dropdown data after postback
body: <p>I am binding dropdown at client side using Jquery. I am fetching data from server using PageMethods.  </p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;asp:DropDownList ID="ddlCountry" runat="server" ClientIDMode="Static" 
                    onchange="return country_changed();" ViewStateMode="Enabled"&gt;
  &lt;/asp:DropDownList&gt; 
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>function GetCountryLst() {
      PageMethods.GetCountryList(OnsuccessCountry);
      return false;
  }
  
  function OnsuccessCountry(result) {
      $("#ddlCountry").append("&lt;option value='Select'&gt;Select&lt;/option&gt;");
      for (var eachval in result) {
           $("#ddlCountry").append("&lt;option value='" + result[eachval].id + "'&gt;" + result[eachval].name + "&lt;/option&gt;");
      }
      return false;
  }
  </code></pre>
  
  <p>On button click when i write </p>
  
  <pre><code>protected void Button2_Click(object sender, EventArgs e)
  {
      var ddlcount = ddlCountry.Items.Count;
  }
  </code></pre>
  
  <p>I get ddlCount = 0; How can i preserve the data </p>