title: calling javascript function in VB.net Code
body: <p>How to call this javascript function in .aspx file in VB.net code. ANy help in this regards would be much appriciable.</p>
  
  <p>$(document).ready(function() {</p>
  
  <pre><code>var numberInput = $('#A_SAtxt, #A_SStxt, #A_RAtxt, #A_CAtxt, #A_OItxt, #A_ICtxt, #A_Otxt');
  
  numberInput.on('change', function() {
      var total = 0;
  
      numberInput.each(function() {
          if ($(this).val() !== '') {
              total += parseFloat($(this).val());
          }
      });
  
      $('#A_TAtxt').val(total);
  });
  </code></pre>
  
  <p>});</p>
  
  <p>I have even tried to do the following in the page load event but it doesn't work.</p>
  
  <pre><code>    Dim sb As New System.Text.StringBuilder()
      sb.Append("&lt;script type = 'text/javascript'&gt;")
      sb.Append(" $(document).ready(function() {")
      sb.Append(" var numberInput = $('#A_SAtxt, #A_SStxt, #A_RAtxt, #A_CAtxt,                 
  
              #A_OItxt, #A_ICtxt, #A_Otxt');")
      sb.Append("  numberInput.on('change', function() {")
      sb.Append(" var total = 0;")
      sb.Append("else{")
      sb.Append(" numberInput.each(function() {")
      sb.Append("  if ($(this).val() !== '') {")
      sb.Append("  total += parseFloat($(this).val());")
      sb.Append(" }")
      sb.Append(" });")
      sb.Append(" $('#A_TAtxt').val(total);")
      sb.Append("  });")
      sb.Append(" });​")
  
      sb.Append("}};&lt;/script&gt;")
      ClientScript.RegisterClientScriptBlock(Me.GetType(), "function", sb.ToString())
  </code></pre>