title: How to get value in code behind from javascript
body: <p>Hello All I am newbie in ASP.NET and trying to get textbox value in code behind but i am unable to do that 
  here is the process i am doing 
  There is gridview in my project and on rowclick i am calling this script
   </p>
  
  <pre><code>    function GetSelectedRow(lnk) {
          var row = lnk.parentNode.parentNode;
          var rowIndex = row.rowIndex - 1;
          var customerId = row.cells[0].innerHTML;
          var suggested_plan = row.cells[1].innerHTML;
          var plan_id = row.cells[5].innerHTML;
          var propsed = row.cells[3].innerHTML;
          var previouscost = row.cells[4].innerHTML;
          document.getElementById('&lt;%=txt_lead_id.ClientID %&gt;').value = customerId;
          document.getElementById('&lt;%=txt_suggested.ClientID %&gt;').value = suggested_plan;
          document.getElementById('&lt;%=txt_suggested.ClientID %&gt;').title = plan_id;
          document.getElementById('&lt;%=txt_previous.ClientID %&gt;').value = previouscost;
          document.getElementById('&lt;%=txt_units.ClientID %&gt;').value = propsed;
  
          return false;
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>and i am getting values in textboxes like txt_lead_id and txt_suggested as well but when in code behind i am getting
    string lead_id = txt_lead_id.Text; Then lead_id is giving me null values i have no idea what is going wrong.</p>