title: how to access usercontrol values through scripts
body: <p>I have a usercontrol with a datalist which comprises of checkboxes. As I cannot pass usercontrol through script, im trying to form a label with selected values, how can i do this</p>
  
  <pre><code>&lt;asp:DataList id="checkedDataList" runat="server" RepeatLayout="Flow" BorderStyle="Inset" BorderWidth="1px"
              Width="100%" style="OVERFLOW: auto" BackColor="White" Height="150px" CssClass="bodytext"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox id=chkBxItems CssClass="bodytext" Text='&lt;%# DataBinder.Eval(Container.DataItem, "Name") %&gt;' runat="server" BackColor="White" ToolTip='&lt;%# DataBinder.Eval(Container.DataItem, "Name") %&gt;'&gt;
                  &lt;/asp:CheckBox&gt;
                  &lt;asp:Label id=lblID Text='&lt;%# DataBinder.Eval(Container.DataItem, "ID") %&gt;' runat="server" Visible="False"&gt;
                  &lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:DataList&gt;
  </code></pre>
  
  <p>this is the usercontrol im using. If i give autopostback='true' to checkbox i'll get the checked values, but returns error from callserver. if no autopostback callserver invokes the serverside methods, but cant get the checked values</p>
  
  <pre><code>    currentPageStatus = document.getElementById("lblStatus").innerText;
      var iv='&lt;%= ucchkLst.funcGetcheckedIDString() %&gt;';
      document.getElementById("lblChkdids").innerText = iv;
      CallServer(currentPageStatus,'');
  </code></pre>
  
  <p>if autopostback=true for checkboxes i get iv as i want, but returns error at callserver. If autopostback not set iv is blank and callserver is successful</p>