title: retrieve repeateritem via jquery
body: <p>I want to retrieve the repeateritem via jquery to my saveorder function on codebehind</p>
  <p>This is my jquery code:</p>
  <pre><code> function saveOrder(controlid) {
          var id = controlid.name.replace(&quot;$btnSave&quot;, &quot;&quot;);
          console.log(id)
          $.ajax({
              type: &quot;POST&quot;,
              url: '/mobile/Default.aspx/saveOrder',
              data: '{par:&quot;' + id + '&quot;}',
              contentType: &quot;application/json; charset=utf-8&quot;,
              success: function (data) {
                  console.log(data.d);
              },
              failure: function (response) {
                  console.log(response.d);
                  alert(response.d);
              }
          });
      }
  </code></pre>
  <p>This is my codebehind code:</p>
  <pre><code> [WebMethod]
  public static void saveOrder(string par)
  {
      mobile_Menu m = new mobile_Menu();
  
      RepeaterItem row =  (RepeaterItem)m.FindControl(par);
  
      RadioButtonList rdblExtraSauce = (RadioButtonList)row.FindControl(&quot;rdblExtraSauce&quot;);
      CheckBoxList chkExtras = (CheckBoxList)row.FindControl(&quot;chkExtras&quot;);
      CheckBoxList chklExtraDrink = (CheckBoxList)row.FindControl(&quot;chklExtraDrink&quot;);
      RadioButtonList rdblExtraOption = (RadioButtonList)row.FindControl(&quot;rdblExtraOption&quot;);
      RadioButtonList rdblSauce = (RadioButtonList)row.FindControl(&quot;rdblSauce&quot;);
      CheckBoxList chkGarnish = (CheckBoxList)row.FindControl(&quot;chkGarnish&quot;);
      List&lt;ListItem&gt; emptyList = new List&lt;ListItem&gt;();
      HiddenField hfProductId = (HiddenField)row.FindControl(&quot;hfProductId&quot;);
      string rdlPriceId = ((RadioButtonList)row.FindControl(&quot;rdblSize&quot;)).SelectedValue.Split(',')[0];
      HiddenField hfMainProductId = (HiddenField)row.FindControl(&quot;hfMainProductId&quot;);
  
  
      //Get previous values
      if (m.Session[&quot;Cart&quot;] != null)
      {
          m.values = (List&lt;Order&gt;)m.Session[&quot;Cart&quot;];
      }
  
      if (chklExtraDrink.Items.Count &gt; 0)
      {
          foreach (ListItem item in chklExtraDrink.Items)
              if (item.Selected) m.values.Add(new Order(item.Value.Split(',')[0], item.Value.Split(',')[1], emptyList, 1));
      }
  
      if (rdblExtraSauce.Items.Count &gt; 0)
      {
          if (rdblExtraSauce.SelectedValue != &quot;Geen saus&quot;)
          {
              m.values.Add(new Order(rdblExtraSauce.SelectedValue.Split(',')[0], rdblExtraSauce.SelectedValue.Split(',')[1], emptyList, 1));
          }
      }
  
  
      switch (Convert.ToInt32(hfMainProductId.Value))
      {
          case 16:
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, m.addMultiChoice(chkGarnish), 1));
              break;
          case 17:
              //values.Add(new Order(hfProductId.Value, rdlPrice, rdblSauce.SelectedItem, addMultiChoice(chkExtras), 1)); ;
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, rdblSauce.SelectedItem, m.addMultiChoice(chkExtras), 1, rdblExtraOption.SelectedItem));
              break;
          case 19:
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, rdblSauce.SelectedItem, m.addMultiChoice(chkExtras), 1));
              break;
          case 20:
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, rdblSauce.SelectedItem, m.addMultiChoice(chkExtras), 1)); ;
              break;
          case 21:
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, rdblSauce.SelectedItem, 1));
              break;
          case 22:
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, rdblSauce.SelectedItem, m.addMultiChoice(chkExtras), 1));
              break;
          default:
              m.values.Add(new Order(hfProductId.Value, rdlPriceId, m.addMultiChoice(chkGarnish), 1));
              break;
      }
  
  
      //Save updated list
      m.Session[&quot;Cart&quot;] = m.values;
  
      if (m.Session[&quot;Cart&quot;] != null)
      {
          m.btnOrder.Text = &quot;Winkelmandje (€ &quot; + Global.CalcTotPrice(m.values) + &quot;)&quot;;
  
      }
  
  }
  </code></pre>
  <p>I am not sure if I am doing it the right way, I am also new with jquery.
  With this code I am getting an NullReferenceException. The uniqueID of the repeaterItem is passed succesfully via the parameter but the conversion to RepeaterItem fails.</p>
  <p>more info: I have a nested Repeater (in total 2), where I want the RepeaterItem of the second Repeater</p>