title: Pass value to a textbox using mvc 5
body: <p>I need to pass a value to a textbox but this textbox can't be writable directly by the user. I'm calculating the value using jason:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#txtid").change(function () {
              $.ajax({
                  url: '/CommissionsFinals/GetTarifa',
                  type: 'GET',
                  contentType: "application/json; charset=utf-8",
                  dataType: 'json',
                  data: { clientID: $("#DDLCliente").val(), consultorID: $("#DDLConsultor").val() },
  
                  success: function (tarifa) {
                      //response(tarifa.
                      $('#txtid').val(tarifa).autocomplete
  
                  },
                  error: function () {
                      alert('Error!');
                  }
              });
  
          })
      });
  </code></pre>
  
  <p>The textbox changes his value when i try to input a diferente value. The value is being calculated by the 2 parameters (clientId,consultorId) which are selected in 2 diferente DropDownLists. How do I get the value automatically after selecting those 2 values from the DropDownList?</p>
  
  <pre><code>&lt;th&gt;
      @Html.DropDownListFor(m =&gt;m.ManagerId, new SelectList(ViewBag.Manager, "ManagerId", "NomeCompleto"), "Seleccione o Manager", new { @class = "form-control", @id = "DDLManager" })
  &lt;/th&gt;
  &lt;th&gt;
      @Html.Label("Consultor", htmlAttributes: new { @class = "control-label col-md-2" })
  &lt;/th&gt;
  &lt;th&gt;
      @Html.DropDownListFor(m =&gt; m.ConsultorId, new SelectList(ViewBag.Consultor, "ConsultorId", "NomeCompleto"), "Seleccione o Consultor", new { @class = "form-control", @id = "DDLConsultor" })
  &lt;/th&gt;
  </code></pre>