title: How to fill textbox with data (its database value) in ajax asp.net mvc?
body: <p>I want to show a data in a textbox that I want to extract from the database. I'm using ajax for this. I have a total of 9 different values from a column called "Urun_gtip". And I want to show these values separately in 9 labels. How can I show them in the view?
  Thanks.</p>
  
  <p>Controller: </p>
  
  <pre><code>public ActionResult Urun_Ad()
  {
      using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["APP_LOG_Con"].ConnectionString))
      {
          object ret = null;
          string query = "select distinct a.Urun_Gtip from RelationTBL a select distinct a.Urun_Gtip from RelationTBL a ";
  
          using (SqlCommand cmd = new SqlCommand(query))
          {
              cmd.Connection = con;
  
              con.Open();
              ret = Serialize(cmd.ExecuteReader());
              con.Close();
          }
  
          return Json(ret, JsonRequestBehavior.AllowGet);
      }
  }
  </code></pre>
  
  <p>View: </p>
  
  <pre><code>   &lt;div class="modal-body" id="modalData2"&gt;
     &lt;div class="row" tabindex="-1"&gt;
     &lt;div class=".col-8 .col-sm-6" style="margin-left:25px;"&gt;
     &lt;label for="Urun_GID" style="color:#dc3545;"&gt;Ürün&lt;/label&gt;
     &lt;input class="form-control" name="Urun_Gtip" id="Urun_GID" disabled&gt;
     &lt;/div&gt;
    &lt;div class=".col-4 .col-sm-6"&gt;
    &lt;label for="Adet" style="color:#dc3545; margin-left:6px;"&gt;Adetleri giriniz: 
    &lt;/label&gt;
    &lt;input class="form-control" onfocus="this.value=''" name="Adet" id="Adet"&gt;
    &lt;/div&gt;
     &lt;/div&gt;
  
  // I have same 9 row (count of query result is 9)
  </code></pre>
  
  <p>jQuery: </p>
  
  <pre><code>$.ajax({
            url: "/Müsavir/Urun_Ad",
            type: "GET",
            success: (data) =&gt; {
               // How can I set data to textbox value here?
            }
         });
  </code></pre>