title: How to avoid postback for the ASP button click event
body: <p>I am using the jQuery multiselect in that I am using button click event which goes the server side and the populates the values on the other dropdownlist. Based on the checked selection in the drop down list it populate the values in the other dropdownlist.</p>
  
  <p>Issue:</p>
  
  <p>For eg: in the first jQuery multiselect dropdown if I select 3 values and close the dropdownlist based on these three values checked the details are fetched in the other jQuery multiselect dropdownlist but the last checked value only is checked and that is retaining. I think it is because of button click event it occurs a asynchronous postback and the values is not retaining. Is their any option to prevent that postback in the button click event but the click should be called then only the values will be retained.</p>
  
  <p>For these I am attaching the screen shot:</p>
  
  <p><img src="https://i.stack.imgur.com/v4FQC.jpg" alt="enter image description here"></p>
  
  <p>Based on that three values it is loaded in the other dropdownlist but it is shows "1 selected" that is default "Select".</p>
  
  <p><img src="https://i.stack.imgur.com/I97D6.jpg" alt="enter image description here"></p>
  
  <p>But the second dropdownlist I can able to get the values that is checked in the first dropdown list:</p>
  
  <p><img src="https://i.stack.imgur.com/jmQLi.jpg" alt="enter image description here"></p>
  
  <p>this is my javascript:</p>
  
  <pre><code>  $(document).ready(function () {
  
              $('.department').multiselect({
                  show: ["bounce", 5], hide: ["blind", 1],
  
                  close: function () {
                      debugger;
                      var values = new Array();
  
                      $(this).multiselect("getChecked").each(function (index, item) {
                          values.push($(item).val());
                      });
                      $("input[id*=selectedValues]").val(values.join(","));
                      document.getElementById("&lt;%=hdnDepartment.ClientID %&gt;").value = values;
                      if (document.getElementById("&lt;%=hdnDepartment.ClientID %&gt;").value != "") {
                          **$("#&lt;%=Button1.ClientID %&gt;")[0].click();**
  
                      }
                  }
  
              })
          .multiselectfilter();
          });
  
  protected void Button1_Click(object sender, EventArgs e)
      {
          Populate();
      }
  </code></pre>
  
  <p>Correct me if i am wrong...</p>