title: Invalid postback or callback argument. When dropdown list populated with jquery and there is a postback
body: <p>I have two dropdown list boxes on change of first I want to fill the second one.
  I have written a jquery for this as follow</p>
  <pre><code>function BindModel() {
  var makeCode = $('#ddMake').val();
  var ddModel = $(&quot;#ddModel&quot;);
  if (makeCode == &quot;0&quot;) {
      return false;
  }
  else {
      $(&quot;#loading&quot;).show();
      $.ajax({
          type: &quot;POST&quot;,
          url: &quot;Services/GetModels.ashx&quot;,
          data: { 'makeCode': makeCode },
          success: function (data) {
              $(&quot;#loading&quot;).hide();
              $.each(data, function () {
                  ddModel.append($(&quot;&lt;option /&gt;&quot;).val(this.ModelCode).text(this.ModelName));
              });
          },
          error: function () {
              $(&quot;#loading&quot;).hide();
          }
      });
  }
  }
  </code></pre>
  <p>I have a generic http handler as follows</p>
  <pre><code>context.Response.ContentType = &quot;application/json&quot;;
          context.Response.ContentEncoding = Encoding.UTF8;
          if( context.Request[&quot;makeCode&quot;]!=null)
          {
              var makeCode = context.Request[&quot;makeCode&quot;].Trim();
              var lobjSearchProps = new CSearchAllProps
              {
                  SearchValue = &quot;%&quot;,
                  MakeCode = makeCode
              };
              var allModelProps = new 
              CModelRestrictionLogic().GetModels(lobjSearchProps).ToList();
              context.Response.Write(JSONHelper.GetJSON(allModelProps));    
          }
  </code></pre>
  <p>where <code>CModelRestrictionLogic().GetModels(lobjSearchProps)</code> is my function which fetches data from the database.<br/>
  and <code>CModelRestrictionLogic().GetModels(lobjSearchProps)</code> converts the list to JSON.
  Every thing is working fine. But whenever I post back it is giving an error:</p>
  <blockquote>
  <p>Invalid postback or callback argument.  Event validation is enabled
  using  in configuration or &lt;%@
  Page EnableEventValidation=&quot;true&quot; %&gt; in a page.  For security
  purposes, this feature verifies that arguments to postback or callback
  events originate from the server control that originally rendered
  them.  If the data is valid and expected, use the
  ClientScriptManager.RegisterForEventValidation method in order to
  register the postback or callback data for validation.</p>
  </blockquote>
  <p>I know the reason because I have filled the dropdown list from jquery so it is getting an error.<br/>
  I have also written function on init to fill the data from posted back values as follow</p>
  <pre><code> protected override void OnInit(EventArgs e)
      {
          var postedOptionValue = Request.Form[ddModel.UniqueID];
          ddModel.Items.Add(new ListItem(postedOptionValue));
          base.OnInit(e);
      }
  </code></pre>
  <p>How can I get rid of this value? I don't want to use enableEventValidation=&quot;false&quot; because it is a security concern.</p>