title: MVC Failed to load resource: the server responded with a status of 500 (Internal Server Error)
body: <p>I have problem with my first MVC project. I'm trying to change values of DropDownList of surnames when select DropDownList of doctor types. I think my action is working. But I cannot use result in view.
  Here my codes:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function () {
              $('select#mCB').change(function () {
                  var docId = $(this).val();
  
                  $.ajax({
                      dataType: 'json',
                      data: 'spec=' + docId,
                      method: 'GET',
                      url: 'LoadDoctors',
                      success: function (data) {
                          $.each(data, function (key, Docs) {
                              $('select#shCB').append('&lt;option value="0"&gt;Select One&lt;/option&gt;');
  
                              $.each(Docs, function (index, docc) {
                                  $('select#shCB').append(
                                      '&lt;option value="' + docc.Id + '"&gt;' + docc.Name + '&lt;/option&gt;');
                              });
                          });
                      },
                      error: function (docID) {
  
                          alert(' Error !');
              }
                  });
              });
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Actions:</p>
  
  <pre><code>public static List&lt;Docs&gt; GetDoctorBySpec(string spec)
          {
              List&lt;Docs&gt; list = new List&lt;Docs&gt;();
  
              string query = "select ID, Familiyasi, Speciality from Doktorlar where Speciality=@spec";
              SqlConnection Connection = new SqlConnection(DataBase.ConnectionString);
              Connection.Open();
              SqlCommand cmd = new SqlCommand(query, Connection);
              cmd.Parameters.Add("@spec", spec);
              SqlDataReader dr = cmd.ExecuteReader();
  
              while (dr.Read())
              {
                  list.Add(new Docs
                  { 
                      Id = dr.GetString(0),
                      Name = dr.GetString(1)
  
                  });
              }
  
              return list;
          }
  enter code here
  enter code here
  [HttpGet]
      public ActionResult LoadDoctors(string spec)
      {
          List&lt;Docs&gt; list = DoctorsService.GetDoctorBySpec(spec);
  
          if (list == null)
          {
              return Json(null);
          }
  
          return Json(list);
  
      }
  </code></pre>
  
  <p>And here my DropDownLists:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="editor-label"&gt;
                  @Html.LabelFor(model =&gt; model.DoktorTuri)
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  @Html.DropDownListFor(model =&gt; model.DoktorTuri, new SelectList(ViewBag.Vrachlar), new { @id = "mCB", @class = "vrachlar" })
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  @Html.LabelFor(model =&gt; model.Shifokori)
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  @Html.DropDownListFor(model =&gt; model.Shifokori, Enumerable.Empty&lt;SelectListItem&gt;(), new { @id = "shCB", @class = "vrachlar" })
              &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Where is my mistake? Thanks for answers</p>