title: how to return table on ajax call in mvc
body: <p>I am new in MVC. I have a DropDown in index view and i want to show entire table basis on selected item from dropdown. I fire ajax on onChange function of dropdown using jQuery.</p>
  
  <pre><code>$(document).ready(function () {
          $("#ddlUser").change(function () {
              $("#ddl2").empty();
              $.ajax({
                  type: "POST",
                  url: '@Url.Action("getState")',
                  dataType: "json",
                  data: { id: $("#ddlUser").val() },
                  success: function (city) {
  
                  },
                  error: function (ex) {
                      alert('failed to retrieve' + ex);
                  }
              })
          });
           return false;
       });
  </code></pre>
  
  <p>and i get data from database using this code</p>
  
  <pre><code>    public JsonResult getState(int id)
      {
          MvcDemo9Feb.Models.ModelData MD = new Models.ModelData(); //MD is object of model and dt is DataTable type property 
          MD.dt = obDB.getCity(id);//obDB is class and getCity is method of it that return datatable
          return Json(MD);
      }
  </code></pre>
  
  <p>here i don't know how to bind data of model object MD to table on view. Please suggest something</p>